Visual Studio“应用程序无法启动,因为应用程序配置不正确”错误
我从朋友那里获得了一些代码,在相同的系统(Windows 7)和相同的 Visual Studio Ultimate 上开发2010,所有库都已相对映射。
代码已构建,但在尝试运行它时出现错误:
由于应用程序配置不正确,应用程序无法启动”
在可执行文件上运行 Dependency Walker 显示msvcr90.dll、ieshishm.dll、ieframe.dll 和 freeglut.dll。 execs 目录并解决了这些问题但是,仍然存在两个问题:
错误:“e:\projects\darwin\code\debug\GLTEMPLATE.EXE”的并排配置信息包含错误。应用程序无法启动,因为其并行配置不正确。请参阅应用程序事件日志或使用命令行 sxstrace.exe 工具了解更多详细信息 (14001)。 警告:由于延迟加载相关模块中缺少导出函数,至少有一个模块存在未解析的导入。
SHLWAPI.DLL 和 IEFRAME.DLL 模块被标记为红色(假设错误消息与这两个模块相关,我该如何解决这个问题?)。
此外,sxstrace 给出了以下结果:
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = x86
CultureFallBacks = en-US;en
ManifestPath = E:\Projects\Darwin\Code\Debug\GLTemplate.exe
AssemblyDirectory = E:\Projects\Darwin\Code\Debug\
Application Config File =
INFO: Parsing Manifest File E:\Projects\Darwin\Code\Debug\GLTemplate.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC90.DebugCRT(...)
INFO: Resolving reference Microsoft.VC90.DebugCRT
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 E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\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.
(...)
还有一些更相似的结果。
我还尝试按照其他相关帖子的建议将运行时库从多线程调试 DLL (/MDd) 更改为多线程调试 (/MTd)。但是,我得到:
MSVCRTD.lib(MSVCR100D.dll):错误 LNK2005:_printf 已在 LBCMTD.lib(printf.obj) 中定义
还有五个类似的。排除 LIBCMTD.lib 允许我构建。但是,我仍然无法运行该应用程序。我得到了和一开始一样的错误。
出了什么问题以及如何解决这个问题?
到目前为止还没有其他相关帖子给我答案。
I obtained some code from a friend, developed on the same system (Windows 7) and same Visual Studio Ultimate 2010, with all the libraries relatively mapped.
The code builds, but when trying to run it I get the error:
Application failed to start because the application configuration is incorrect"
Running Dependency Walker on the executable showed that msvcr90.dll, ieshishm.dll, ieframe.dll and freeglut.dll could not be found. I copied these to the execs directory and that solved these problems. However, two issues remain:
Error: The Side-by-Side configuration information for "e:\projects\darwin\code\debug\GLTEMPLATE.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail (14001).
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
With SHLWAPI.DLL and IEFRAME.DLL modules being marked red (assuming error message relates to these two, how do I fix that?).
Also, the sxstrace gave following result:
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = x86
CultureFallBacks = en-US;en
ManifestPath = E:\Projects\Darwin\Code\Debug\GLTemplate.exe
AssemblyDirectory = E:\Projects\Darwin\Code\Debug\
Application Config File =
INFO: Parsing Manifest File E:\Projects\Darwin\Code\Debug\GLTemplate.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC90.DebugCRT(...)
INFO: Resolving reference Microsoft.VC90.DebugCRT
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 E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at E:\Projects\Darwin\Code\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.
(...)
And some more similar.
I also tried changing the runtime library as suggested on other related posts from multi-threaded debug DLL (/MDd) into multi-threaded debug (/MTd). However, I get the:
MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _printf already defined in LIBCMTD.lib(printf.obj)
And some five more similar. Excluding LIBCMTD.lib allows me to build. However, I still cannot run the application. I get the same error as in the very beginning.
What is going wrong and how do I fix this?
No other related posts gave me the answer so far.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的项目使用一个或多个使用 Visual Studio 2008(Visual Studio 的早期版本)构建的库。他们需要 C 运行时库才能使该版本可用;这就是它抱怨 msvcr90.dll 的原因。您已经安装了 Visual Studio 2010;您的计算机上只安装了 msvcr100.dll。
仅复制 msvcr90.dll 是行不通的;该 DLL 需要安装在 Windows 并行缓存中。您可以从 Microsoft 或您的朋友那里获取安装程序。然而,这并不是真正的解决办法。您的应用程序仍然存在问题,具体取决于两个 CRT 版本。非常不健康,可能会导致难以诊断的崩溃和内存泄漏。您需要使用 Visual Studio 2010 重建库。这就是我的建议失败的地方;我无法从你的问题中猜出这些库是什么。
Your project uses one or more libraries that were built with Visual Studio 2008, the previous version of Visual Studio. They require the C runtime library for that version to be available; that's why it is complaining about msvcr90.dll. You've got Visual Studio 2010; you only have msvcr100.dll installed on your machine.
Just copying msvcr90.dll isn't going to work; that DLL needs to be installed in the Windows side-by-side cache. You can get an installer from Microsoft or from your friend. That's, however, not the true fix; you still have a problem with your application depending on two versions of the CRT. Very unhealthy, that can cause very-hard-to-diagnose crashes and memory leaks. You need to get the libraries rebuilt with Visual Studio 2010. That's where my advice fizzles out; I can't guess what those libraries are from your question.
"msvcr90" <- 我很确定这不是 2010 版本;无论如何都不是发布。我敢打赌,在混合中的某个地方,您正在链接到针对较旧的运行时构建的东西,但还不够旧,无法与 win7 一起安装。
您不想在链接到第 3 方 DLL 或您自己的 DLL 时切换到静态运行时。
"msvcr90" <- I'm pretty sure that's not the 2010 version; not the release anyway. My bet is that somewhere in the mix you're linking to something built against an older runtime but not old enough to be installed with win7.
You don't want to switch to the static runtime while linking to 3rd party DLL's, or your own DLL's.
问题很可能是显而易见的。
我设置配置属性/链接器/清单文件/生成清单==否
程序开始启动。
It is possible the problem in manifest.
I set Configuration Properties/Linker/Manifest file/ Generate manifes==No
and program began starting.