Downloading debug redistributable VS2008 applications compiled with VS2015 fails

My application (compiled with VS20 15 ) loads a third-party DLL (compiled with VS20 08 ). Launching the application in the release requires only redistributable resources for VS2008 and VS2015 from the MS web page on the target machine.

Running the application in debug mode (for example, on another developer's machine) requires debugging the distributed components of VS2008, which should be avoided. Copying the msvcX90 d .dll file near a third-party DLL does not succeed. Any ideas how I can convince Windows to load the VS2008 debugging environment? Does my application require a manifest, and which one?

FYI on mixing battery life

Yes, I am not comfortable with a mixed runtime, but in my context, both runtimes will not interact with each other. And recompiling a third-party DLL is not an option.

To simplify the task even more. How to download msvcr90d.dll file in compiled VS2015 application?

LoadLibrary(L"msvcr90d.dll");

enter image description here

+4
source share
1 answer

After reading the helfpful resources from the comments, here is my approach on how to load the debug distributed by VS2008 (msvcr90d.dll) into VS2015 (release and debugging).

First, your application needs a manifest file. What is a manifest file? This page describes it very well: http://www.samlogic.net/articles/manifest.htm

XML , , Windows . ( ), XML .

( ). / Projects Property Page -> Linker -> Manifest Tool -> Input and Output -> Embed Manifest.

  • ( ) .

  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\amd64\Microsoft.VC90.DebugCRT

  • Microsoft.VC90.DebugCRT.manifest publicKeyToken="1fc8b3b9a1e18e3b". , Windows msvcr90d.dll. , , .

  • #include <Windows.h>
    
    #pragma comment(linker,"/manifestdependency:\"type='win32' "\
       "name='Microsoft.VC90.DebugCRT' "\
       "version='9.0.21022.8' "\
       "processorArchitecture='amd64' "\
       "\"") 
    
    int main()
    {
        auto* lib = LoadLibrary(L"msvcr90d.dll");
        if (!lib)
        {
            return -1;
        }
        FreeLibrary(lib);
        return 0;
    }
    

(Microsoft.VC90.DebugCRT.manifest) ( ) ? , , . - , .

enter image description here

enter image description here

: MSDN .

2: , Microsoft.VC90.DebugCRT.manifest, ( ), , , ,

+2

Source: https://habr.com/ru/post/1694987/


All Articles