C#调用C++的DLL报错,怎么解决

2025年03月01日 07:29
有1个网友回答
网友(1):

windows上dll的查找规则为:

  1. exe所在目录

  2. 当前工作目录

  3. Windows系统目录

  4. Windows目录.

  5. PATH中指定的目录

试试将dll放到exe所在目录。


SO上有一个类似的问题,可以参考:http://stackoverflow.com/questions/8836093/how-can-i-specify-a-dllimport-path-at-runtime