System.DllNotFoundException: Unable to load DLL into window 2003

I have a C ++ dll using C # in my project, it worked fine on my xp window machine, but when I copy my debug project to a Windows 2003 (x64) server, I got the error below, can anyone tell to me, what is the problem, and how can I fix it.

thanks

"System.DllNotFoundException: Unable to load DLL 'lib.dll': this application could not be started because the application configuration is incorrect. Re-installing the application may fix this problem"

+7
c # dll dllnotfoundexception
source share
4 answers

He complains that he is having trouble finding CRT DLL elements. First check if the DLL contains the required manifest. In Visual Studio, File + Open + File, select the DLL and make sure it contains the RT_MANIFEST node. The next problem is that you cannot deploy the debug assembly of your DLL. It will depend on the debug version of CRT, you will not be able to install it on the target machine.

Expand the release build of your DLL or compile the DLL with the / MT option so that the CRT is statically linked. Project + Properties, C / C ++, Code Generation, Runtime Library. This will not work if the DLL was compiled with the / clr option.

+11
source share

For a problem loading a DLL, I suggest you use a tool

+6
source share

Is lib.dll 32-bit dll? Your C # program will run on x64 initially, but will not be able to load 32-bit DLLs. You can try changing the target processor of the C # project to "x86" to make it work under WOW64.

+2
source share

it sounds like you haven't set the visual C ++ runtime on the target machine. You can install it from here. It seems that using debug versions of these libraries, maybe you also need to create the application in release mode first? There are other suggestions in this post and this one that may help ...

+1
source share

All Articles