DllNotFoundException, but DLL is there

微笑、不失礼 提交于 2019-11-28 00:38:17

It is probably this dll has some dependencies that they arent registred or arent in the same folder of your application.

Open DLL on the problematic system in http://www.dependencywalker.com/

Perhaps you should check to see if you're expecting a specific product version of the dll, and make sure that the product versions still match up correctly.

I ran into this problem and solved with the following:

There's a dependency on msvcr90.dll if you compile under /MD. Try compiling the code with /MT instead.

Project properties > C/C++ > Code Generation > Runtime Library: /MT

I was dealing with the same exception with regards to one of my DLL's (let's call it A). C# was crashing because it claimed it couldn't find this DLL (A) (while it was there in the same folder as the executable).

Turned out that the issue was caused by A having dependency on another DLL (call it B). B was not in the path so A couldn't load it when it needed it. Since B needed a whole bunch of other DLL's, the solution was to add B's directory to the PATH environment variable.

It's interesting how C# crashes with the error saying that A is not found when in fact B was not found...

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