【发布时间】:2016-01-13 04:54:40
【问题描述】:
我有一个在 VS2013 中运行的 x86 C++ 应用程序,我正在升级到 VS2015。构建和链接工作正常,但运行时出现错误:
无法启动程序。此应用程序无法启动,因为 应用程序配置不正确。查看清单文件 对于可能的错误。重新安装应用程序可能会解决此问题 问题。有关详细信息,请参阅应用程序事件日志。
应用程序事件日志显示:
“MyApp.exe”的激活上下文生成失败。 相关程序集 Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" 找不到。 详细诊断请使用sxstrace.exe。
所以我运行 sxstrace 并得到:
=================
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = Wow32
CultureFallBacks = en-US;en
ManifestPath = MyApp.exe
AssemblyDirectory = MyApp\Debug\
Application Config File =
-----------------
INFO: Parsing Manifest File MyApp.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762"
INFO: Resolving reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762".
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.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.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.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL.
INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.DLL.
INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.DLL.
INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762".
ERROR: Activation Context generation failed.
End Activation Context Generation.
我不确定这有什么帮助,如果我在 VS2015 中从头开始构建应用程序,我仍然不明白为什么会出现此错误。我尝试安装对应于版本 8.0.50727.762 的Microsoft Visual C++ 2005 SP1 Redistributable Package (x86),但没有帮助。
很多关于这个主题的旧帖子(例如Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one?)都提到检查构建生成的 .manifest 文件,但我找不到。 VS2015 不再生成它们了吗?
【问题讨论】:
-
您可能正在链接到使用 VS 2005 编译的库,而您正在尝试使用 VS 2015 编译和链接您的应用程序。这种不兼容性可能会导致问题。你有图书馆的源代码吗?您能否对整个解决方案进行完整的重新编译和链接,包括您正在使用的任何库依赖项?
-
我确实有一些第三方库,但是为什么它在VS2013中可以工作,为什么安装VS2005依赖项没有帮助?
-
两者都有,但不是用 VS2015 构建的静态链接的会出现链接器错误,直到我重建它们,所以它们没问题。
-
部分3rd方库生成或有props文件;如果你在文本编辑器中打开它,可能会有一些 xml 或脚本告诉它可能依赖的其他库的版本,或者它期望使用哪个版本的 VS。您可能必须自己改变这些;例如,在处理音频时,我使用 OGG-Vorbis 和 OpenAL。我不记得究竟哪个依赖于另一个,但我认为 Vorbis 依赖于 Ogg 并且 Vorbis 有一个必须手动修改的道具文件。
标签: c++ windows-7 visual-studio-2015