Visual Studio 2012 Debug .exe需要Microsoft.VC90.DebugCRT

时间:2015-04-09 23:45:13

标签: visual-studio side-by-side winsxs vc90

当我构建调试配置时,.exe无法启动。

报告

  

应用程序无法启动,因为它的并排配置不正确。请参阅应用程序事件日志或使用命令行sxstrace.exe工具获取更多详细信息。

我使用了sxstrace.exe工具。它报告以下错误:

  

错误:无法解析参考Microsoft.VC90.DebugCRT,processorArchitecture =" amd64",publicKeyToken =" 1fc8b3b9a1e18e3b",type =" win32",version =& #34; 9.0.21022.8"

我已经阅读了很多与这些并排错误相关的帖子。我尝试安装Visual Studio 2008可再发行组件包,希望在C:\ Windows \ winsxs中安装缺少的调试.dll。但是,我看到了

  

应用程序的调试版本和各种Visual C ++ DLL不可再发行。

https://msdn.microsoft.com/en-us/library/8kche8ah%28v=vs.110%29.aspx

如何解决此问题?

1 个答案:

答案 0 :(得分:-1)

调试版本的清单文件不正确。这是我的VS2013的样子。注意"要求DEBUG 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>