I have C# WPF application in which I have used C++ DLL libraries. When I build my project it builds successfully and all my DLL and exe are stored in bin/(Platform) e.g. (bin/Debug) folder.
Now if I copy the Debug
folder and paste it anywhere in my system and try to run the exe then it runs successfully but if I copy the Debug
folder to the another system and then try to run the exe it shows error:
Unable to load DLL (Module could not be found HRESULT: 0x8007007E)
Any suggestions or help will be appreciated.
I have tried setting the same Configuration and Platform for both DLL and exe. But still can't figure out that the exe is perfectly running on my system and if tried on another system it's showing "Unable to load DLL" error.
I have faced the same problem when using unmanaged c++ dll libraries in c# environment.
1.Check the compatibility of dll with 32bit or 64bit CPU.
2.Check the correct paths of DLL .bin folder, system32/sysWOW64 , or given path.
3.Check the DLL's Configuration Properties > C/C++ > Code Generation >Runtime Library, for all DLL's runtime library should be same.
This issue could arise because of platform incompatibility. You can change it from Build>Configuration manager.
In my condition some of my dll's Runtime Library was set to MDD and others to MTD, converting to same Runtime Library helped me out.