August 23rd, 2010, 02:41 PM
mix-up with DLL dependencies
I have a C# .NET application that was created a couple of years ago in VS 2005. It's a console app that depends on a bunch of DLLs. One of them is a managed C++ DLL. I just rebuilt the app (and all the DLLs) in VS2008. It throws a runtime exception. Part of the message reads:
Could not load file or assembly '<myManagedCppDLL>, Version=1.0.3887.18851, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
where myManagedCppDLL is the above-mentioned managed C++ DLL.
I am not sure what's going on here. Both the debug and the release versions of the app throw the same exception. This was not happening before when we were originally developing the app under VS2005.
--- One strange fact that may or may not have something to do with this: After I "batch rebuild all", the Release folder of the app contains all the DLLs it depends on, directly or indirectly. Actually, the app depends on a .NET DLL that in turn depends on the managed C++ DLL. So I have three copies of the managed DLL:
1. in the debug/release folder of the managed DLL
2. in the debug/release folder of .NET DLL that depends on it
3. in the debug/release folder of app
I noticed that in the release location #1 I have the right DLL while in #2 and #3 I have the debug versions of the managed DLL instead of the release one.
--- Another strange fact is that when I open the release version of the managed DLL in the Dependency Walker, all is well. When I open its debug version, it shows three MS DLLs as missing:
What's going on here?
August 25th, 2010, 06:22 PM
Re: mix-up with DLL dependencies
Sorry, I can't help you with the other aspects of the issue, but I think at least I can shed some light on this one:
These DLLs belong to the debug version of VS 2008's C++ runtime. You should have them if you have an installation of VS 2008. Or is it actually VC# 2008 Express Edition?
Originally Posted by ilyaz
I suppose your "managed DLL" actually is a mixed-mode DLL that contains managed and unmanaged code. Otherwise it wouldn't pull in these DLLs, IMO.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.