Excel DNA with ILNumerics

淺唱寂寞╮ 提交于 2021-01-28 21:29:20

问题


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:

enter image description here

Any pointers on how to resolve this would be appreciated.


回答1:


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.



来源:https://stackoverflow.com/questions/30863959/excel-dna-with-ilnumerics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!