I have a freshly installed development machine with Windows 7 and Visual Studio 2010, Service Pack 1.
In our solution we have a C++ DLL which is used by several applications.
In the Release configuration everything works fine but in Debug configuration I get the error dialog that the application was unable to start correctly when I try to run one of the applications.
I figured out that it is a problem with the SxS configuration in our C++ DLL. For some reason the manifest of the DLL contains the following reference:
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
And there is no Debug version of the VC90 runtime libraries installed on my machine.
Since we had some similar problems before we always make sure that the external libraries we are using are compiled with the same VS version we use for development.
But it looks like there is a reference to the VC90 DebugCRT somewhere. I tried to figure it out using Dependency Walker and PeStudio on our external libra开发者_高级运维ries but I could not find any reference to the VC90 DebugCRT Dll anywhere.
I actually fixed the issues by disabling the generation of the manifest file in the linker settings of our Dll. So the VC90 DebugCRT is actually not required for the application to run but pulled in somehow anyway.
I just was wondering now how VS determines during the build process which references to include into the manifest file and how can I diagnose where this reference comes from?
Check the typical issues first, such as "Properties/C++/Code Generation/Runtime lib" and that "_DEBUG" isn't defined, for both application and libs you depend on. If that doesn't find it, turn on verbose linking "Linker/General/Show Progress" and see if that tells you what it's looking for in the debug crt.
精彩评论