1

I have created a C# winforms application with VS2013, which includes C++ DLLs for which I also have the code. This app runs fine on my win7 64bit machine. When I run it on my colleague's machine for a deployment test (same hardware, same OS, no VS2013), the app crashes and says that one of the C++ DLL or its dependencies cannot be found.

When I run dependency walker on my machine, it lists the same missing DLLs than in this thread: Win 7, 64 bit, dll problems

So I followed the solutions mentioned there and installed the C++ Redistable Packages 2005, 2008, 2010, 2012 and 2013, but to no success.

All projects target .NET 4.0 (x86). The C++ project hold a lot of external references, but only to .NET DLLs and C++ header files, most of the latter are from c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include I do not need to deploy header files, do I?

Does anybody have a clue how to proceed?

Community
  • 1
  • 1
ondrums
  • 158
  • 11
  • Are the C++ DLLs release or debug build? – mclaassen Jun 20 '14 at 14:36
  • Debug builds, also the C# exe – ondrums Jun 20 '14 at 14:41
  • 3
    That might be the problem. When you download VC++ Redist packages they might not include the debug builds which your C++ DLLS are linked against. Try using release build of C++ DLLs and see if that works, then you will know that that is the problem. – mclaassen Jun 20 '14 at 14:42
  • Another way to avoid DLL HELL is to statically link http://stackoverflow.com/questions/2035287/static-runtime-library-linking-for-visual-c-express-2008 which has the problems listed there but hey no DLL HELL. – IdeaHat Jun 20 '14 at 14:54
  • you could use ilspy from (ilspy.net) to see the problem loading the assembly/dll. – AnthonyLambert Jun 20 '14 at 14:54

1 Answers1

1

This could be because your C++ DLLs are a debug build and are dynamically linked against the debug versions of the VC++ runtime libraries used by the version of VS where they were built. You can either build release versions of your C++ DLLs and use those instead, in which case the installed VC++ redistributable packages should provide the correct runtime libraries, or you could get the debug versions of the required VC++ runtime libraries and ensure those are present on the target machine.

If you must use the debug version of your C++ DLLs then Microsoft provides some instructions on how setup your test machine here.

mclaassen
  • 5,018
  • 4
  • 30
  • 52
  • Thank you for this suggestion, sounds very good. Because of my schedule, I can't test it before Thursday next week, but for sure I'll post the result here. – ondrums Jun 20 '14 at 19:24
  • After building the DLLs for "Release", everthing works fine. I wasn't aware of the differences of the configuration. – ondrums Jun 26 '14 at 06:55