abbas-h
abbas-h

Reputation: 450

excel dna addins how pack unmanaged dll in xll file

I want use ml.net to make Excel function ml.net in .NET framework classics need one unmanaged dll ... when I manually copy dll in debug folder all work great . excel DNA not support unmanaged dll that not contain in reference folder ... how I pack unmanaged dll and pack in xll file ?

Upvotes: 0

Views: 1159

Answers (1)

C. Augusto Proiete
C. Augusto Proiete

Reputation: 27818

The Excel-DNA packing does not currently support packing of unmanaged DLLs, thus you won't be able to use the built-in packaging mechanism (i.e. ExcelDnaPack) to pack the ml.net unmanaged DLL.

As a workaround, you can add the ml.net unmanaged DLL as an embedded resource in your .NET assembly, and then extract it to disk at the start of your add-in, before any of the code that uses the DLL had the chance to run.

You then would call LoadLibrary yourself to load that unmanaged DLL into the process.

Some useful links for reference:

Upvotes: 3

Related Questions