Unable to find DLL when website runs in IIS

2

When I run the website locally using my VS, everything works.

I am calling a function inside a dll using P/Invoke. 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

c#
asp.net
c++
iis
asked on Stack Overflow Feb 9, 2011 by InfoLearner

2 Answers

1

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!

answered on Stack Overflow Feb 9, 2011 by Nawaz
0

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.

answered on Stack Overflow Mar 17, 2021 by Krur Schak

User contributions licensed under CC BY-SA 3.0