I have a c# .net 4 app , using vs 2010. Im trying to import a c++ dll (built on vs 2005).
[DllImport("Card.dll")]
I get the failure:
Unable to load DLL 'Card.dll': The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)
using sxstrace.exe I get:
ERROR: Cannot resolve reference Microsoft.VC80.DebugMFC,processorArchitecture="x86"
I also found out that:
MFC80D.DLL and MSVCR80D.DLL are missing
Notice this is not DebugCRT, as this problem was caused by using a Debug compiled DLL instead of Release. I now use the Release compiled dll and the problem is DebugMFC.
I've tried anything I could find online. In order to save time I will introduce what I tried, so I won't get this advises again:
1- I have installed Microsoft Visual C++ 2010 Redistributable Package + SP1 + Security updates
2- I have installed Microsoft Visual C++ 2008 Redistributable Package
3 - I have installed Microsoft Visual C++ 2005 Redistributable Package
4 - I tried running this app as "Release" and not as "Debug"
5 - I tried to set entryPoint to the DllImport
Non helped. I still get the same error. I didn't see any other advise online instead of the one listed above. Can anyone help me?
Please see the application event log
. What does it say? – Hans Passant