当我构建调试配置时,.exe无法启动。
它报告
应用程序无法启动,因为其并行配置不正确。有关详细信息,请参阅应用程序事件日志或使用命令行sxstrace.exe工具。
我使用了sxstrace.exe工具。它报告以下错误:
错误:无法解析引用Microsoft.VC90.DebugCRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。
我读过很多与这些并列错误相关的帖子。我尝试安装Visual Studio 2008可再发行包,希望丢失的debug.dll能安装在C:\Windows\winsxs中。然而,我看到
应用程序的调试版本和各种Visual C++DLL是不可重新分发的。
在https://msdn.microsoft.com/en-us/library/8kche8ah%28v=vs.110%29.aspx.
如何解决此问题?
调试构建的清单文件不正确。以下是我的VS2013的外观。请注意"需要调试CRT"选项。现在要加载这个,在我的RC文件中,我有:
#ifdef _DEBUG
1 24 "profiler.exe.debug.manifest"
#else
1 24 "profiler.exe.manifest"
#endif
这是MyProgram.exe.debug.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<!-- Declare your Identity -->
<assemblyIdentity type="win32" name="YOUR_COMPANY_NAME" version="1.0.0.0" processorArchitecture="*" />
<!-- Require Common Controls version 6 -->
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
</dependentAssembly>
</dependency>
<!-- Require DEBUG CRT -->
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="*" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<!-- Declare support for Vista and Windows 7 -->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
<!-- Declare Privileges -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<!-- Declare High DPI support -->
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>