【问题标题】:Visual Studio "Application failed to start because the application configuration is incorrect" errorVisual Studio“应用程序无法启动,因为应用程序配置不正确”错误
【发布时间】:2011-07-10 02:08:53
【问题描述】:

我从朋友那里得到了一些代码,在同一个系统(Windows 7)和同一个Visual Studio Ultimate 2010上开发,所有的库都相对映射。

代码已构建,但在尝试运行时出现错误:

应用程序配置错误导致应用程序启动失败”

在可执行文件上运行 Dependency Walker 显示 msvcr90.dllieshishm.dllieframe.dllfreeglut。找不到 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 已在 LIBCMTD.lib(printf.obj) 中定义

还有五个类似的。排除 LIBCMTD.lib 允许我构建。但是,我仍然无法运行该应用程序。我得到了和一开始一样的错误。

出了什么问题,我该如何解决?

到目前为止,没有其他相关帖子给我答案。

【问题讨论】:

    标签: c++ visual-studio-2010 linker


    【解决方案1】:

    您的项目使用一个或多个使用 Visual Studio 2008(Visual Studio 的早期版本)构建的库。它们需要 C 运行时库才能使该版本可用;这就是它抱怨 msvcr90.dll 的原因。您拥有 Visual Studio 2010;你的机器上只安装了 msvcr100.dll。

    仅仅复制 msvcr90.dll 是行不通的;该 DLL 需要安装在 Windows 并行缓存中。您可以从 Microsoft 或您的朋友那里获得安装程序。然而,这不是真正的解决办法。根据 CRT 的 两个 版本,您的应用程序仍然存在问题。非常不健康,可能会导致难以诊断的崩溃和内存泄漏。您需要使用 Visual Studio 2010 重建库。这就是我的建议失败的地方;我无法从您的问题中猜出这些库是什么。

    【讨论】:

    • 不,我确实也安装了 mscvr90.dll,因为它与我已经安装的 VCRedist_x86 一起安装......另外,该项目完全是用 VS2010 构建的,所以为什么我仍然得到这种错误?
    • 如果您的项目完全使用 VS2010 构建,那么您将永远不会依赖 msvcr90.dll。你错过了一个,我猜不出是哪个。使用链接器的 /VERBOSE 选项并确保您可以说明您看到的每个 .lib 正在使用。哦,还有 vcredist_x86 的 3 个版本,您必须选择正确的一个。最后一个有 ATL 安全补丁的最好。
    【解决方案2】:

    "msvcr90"

    您不想在链接到第三方 DLL 或您自己的 DLL 时切换到静态运行时。

    【讨论】:

      【解决方案3】:

      可能是清单中的问题。 我设置配置属性/链接器/清单文件/生成清单==否 程序开始启动。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-10-28
        • 2010-11-02
        • 2011-05-23
        • 1970-01-01
        • 1970-01-01
        • 2016-01-25
        • 2011-04-27
        相关资源
        最近更新 更多