DLL not found in distributed application

强颜欢笑 提交于 2019-12-11 05:16:00

问题


I've written a pretty simple Windows Form Application that calls an unmanaged DLL to perform most of the actual calculations done by the program. The program runs fine in Debug and Release modes. It also installs correctly and runs on the development computer.

The problem arises when I attempt to install it on target computer (running the same operating system: 64bit Windows 7). Despite the DLL being in the same directory as the .exe file, I'm getting a "DLL Not Found Exception". I'm getting this exception when I attempt both OneClick publishing as well as when I use a .msi installation file. The error will even cite the location of the file while stating the file could not be found.

Is one of my installer settings incorrect? Am I not including the DLL or a reference in the appropriate place? Any help or advice would be appreciated.

Thanks.


回答1:


The DLL you deployed may have additional dependencies that you haven't deployed. If those dependencies aren't there then you'll generally get this type of error.

UPDATE:

The "D" in MSVCR100D means that it's the debug version of the library. That most likely isn't on the target system and licensing prevents you from deploying it.

You need to do a full recompile under Release mode. Once that is done your DLL should target MSVCR100 (note the lack of "D") instead. If not, then you probably have a debug build of that assembly. Locate a release version and link to that.




回答2:


If you are invoking the unmanaged code by calling CreateObject then make sure that you have registered the unmanaged DLL on target computer as well.




回答3:


In a post about a similar 'dll not found' error at Microsoft: http://support.microsoft.com/kb/319114 you can learn how to fix this problem based on the fact that it might happen due to: 1) Missing or corrupt dll file (also here) 2) The registration path which is calling that that dll is probably wrong/missing/damaged somehow. Otherwise you might want to verify that new virus/malware is around...



来源:https://stackoverflow.com/questions/7603243/dll-not-found-in-distributed-application

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