Unable to find DLL when website runs in IIS
When I run the website locally using my VS, everything works.
I am calling a function inside a dll using P/Invok开发者_Go百科e. DLL is in C++ and it works.
When I deploy the website on IIS, I get the error message
Unable to load DLL 'SolvingProbelm.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The dll resides inside the bin folder. App pool is Classic and .net 2.0
Any suggestions will be appreciated.
Regards
I had faced the similar problem once. Just copy SolvingProbelm.dll
to C:\WINDOWS\System32
. Hopefully, it will work! It had worked in my situation. Actually native DLLs and .Net DLLs are searched differently. IIS searches native DLLs in C:\Windows\System32
folder also. So copying your DLLs there solves problems!
I know it's been 10 years. But if someone should encounter the problem again, just make sure that Platform and Configuration have not changed in Project Properties under Build. In my case, Visual Studio had simply changed the Platform to All Platforms even though I had built all dlls before using Any CPU.
Today I faced this same problem with a software a little bit old (ASP.NET). As you can see here:
Finally I found the explanation to my problem here How do I get IIS to load a native DLL referenced by my WCF service? Please, take a look it solved all my doubts.
精彩评论