mix-up with DLL dependencies
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: mix-up with DLL dependencies

  1. #1
    Join Date
    Jan 2010
    Posts
    13

    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:
    1. MSVCR90D.dll
    2. MSVCP90D.dll
    3. MSVCM90D.dll

    What's going on here?

    Thanks much!

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,594

    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:

    Quote Originally Posted by ilyaz View Post
    --- 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:
    1. MSVCR90D.dll
    2. MSVCP90D.dll
    3. MSVCM90D.dll

    What's going on here?
    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?

    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.

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center