一.netcore调用C++提供的Windows动态库.dll异常
System.DllNotFoundException: Unable to load DLL 'xx.dll' or one of its dependencies: 找不到指定的模块。 (0x8007007E)
下载依赖项检查工具denpends,将dll拖进去会显示缺少的依赖(黄色背景问号),从sytem32或者SysWOW64中找到后复制到项目文件夹即可.
注意:以C++提供的是32位dll为例,机器是64位系统时,system32中的dll是64位的,所以应该去SysWOW64中找对应dll.
二.netcore调用C++提供的linux动态库.so异常
System.DllNotFoundException: Unable to load shared library 'libxx.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libXX.so: cannot open shared object file: No such file or directory
异常时始终提示找不到文件,实际上文件是存在的.
使用ldd