简体   繁体   中英

Excel DNA with ILNumerics

I have used ILNumerics via Excel DNA in Excel successfully for some time. Now I wrote a new function which uses the linsolve function from ILNumerics (which needs the mkl_custom.dll) and I cannot build this into an XLL. My custom function works in debug which is why I assume sth in the packaging goes wrong.

Here is my dna file:

<DnaLibrary Name="Nik's Lib" RuntimeVersion="v4.0">
   <ExternalLibrary Path="MyLib2010.dll" Pack="true"/>
   <Reference  Path="ILNumerics.dll" Pack="true"/>
   <Reference  Path="mkl_custom.dll" Pack="true"/>
</DnaLibrary>

When packaging this I get the error message that path for mkl_custom.dll

path not found

This might be due to the folder structure of the dll:

在此处输入图片说明

Any pointers on how to resolve this would be appreciated.

The Excel-DNA packing does not currently support native or mixed assemblies. So you won't be able to use the mechanism to pack the mkl library.

You might be able to store it in your C# assembly as a resource, and extract it yourself at runtime (in an AutoOpen or something, before any of the functions using it are run). If you extract it to a temp file, then call LoadLibrary yourself to load it into the process, it should work when ILNumerics needs it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM