简体   繁体   中英

Side-by-Side configuration incorrect due to incorrect manifest

I initially asked this question on the libRocket forum, but given that further investigation suggests this is more of a general C++/Visual Studio related problem, I am asking here.

I am running Visual Studio C++ 2010 Express and have downloaded the full Win32 source code to libRocket 1.2.1. I have successfully compiled it in debug mode without errors or warnings and am now trying to get it to run within my application, which is built on top of SFML 1.6.

My application compiles without errors or warnings against the recompiled libRocket. As soon as I try to run it, however, I get an error message saying The application was unable to start correctly (0xc0150002). Click OK to close the application. The application was unable to start correctly (0xc0150002). Click OK to close the application.

When I open my executable with Dependency Walker, I am getting the following error:

Error: The Side-by-Side configuration information for "ROCKETCORE_D.DLL" contains errors. The application has failed to start because its side-by-side configuration is incorrect.

I find this strange because it also shows both my application and RocketCore_d.dll depending on MSVCP100D.DLL and MSVCR100D.DLL. No mismatch there. So I then performed an sxstrace :

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = Binaries\Debug\RocketCore_d.dll
    AssemblyDirectory = Binaries\Debug\
    Application Config File = 
-----------------
INFO: Parsing Manifest File Binaries\Debug\RocketCore_d.dll.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
INFO: Resolving reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
    INFO: Resolving reference for ProcessorArchitecture WOW64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
               INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
                INFO: Attempt to probe manifest at Binaries\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
   ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.

It would appear that my system is missing the Visual Studio 2008 runtime. Is this correct? Version 9.0.21022 of the VS2008 redistributable is in fact present on my system. But even so, considering I recompiled libRocket using VS2010, shouldn't it be referencing the VS2010 runtime?

I believe this error stems from a configuration in the newly compiled libRocket's manifest file:

    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">    </assemblyIdentity>
    </dependentAssembly>

I can see where it is coming from since the application was originally written for VS2008 but how can I get VS2010 to generate the correct manifest? The projects properties indicate it is being automatically generated.

Note that this problem only occurs in debug mode, it runs just fine in release. I would of course highly prefer to be able to run it in debug mode on my developer system.

Any pointers on how to resolve this very much appreciated!

Thanks!

shouldn't it be referencing the VS2010 runtime?

No, VS2010 no longer stores the CRT in the side-by-side cache. It is back in c:\\windows\\system32, no manifest is needed to find it. Microsoft changed their mind after receiving too many complaints from customers that struggled with the kind of problem you are having.

<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" .../>

This is your core problem. Not only does your program have a dependency on an old version of the CRT, it is the wrong version too. The debug version of the CRT cannot be deployed and only works on machines that have VS2008 installed. Like yours.

You'll definitely need to fix this, mixing CRT versions can cause a lot more problems beyond deployment issues. You are linking a .obj or .lib that was built with VS2008 in the Debug configuration. You'll need to find the project that generated that file and rebuild it so it uses the correct configuration and CRT version. If you have no clue then you could grep the .obj and .lib files for "DebugCRT".

solution for your problem @ SideBySide Error

just copy the dlls and manifest files of the versions in your application debug folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM