【问题标题】:Application has failed to start ... application configuration is incorrect - VC++ 2005 Runtime Problem应用程序无法启动...应用程序配置不正确 - VC++ 2005 运行时问题
【发布时间】:2008-11-05 15:28:25
【问题描述】:

我们将 Visual C++ 2003 解决方案移至 Visual 2005,现在我们在部署到干净的 XP 机器时遇到问题。

我们的解决方案有一个 DLL 项目和一个使用该 DLL 的命令行可执行文件。两个项目都创建和嵌入清单文件。

我们的安装程序还将 VC8 CRT 运行时从 C:\Programme\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\ 复制到安装目录。

当我们在干净的 Windows XP 上安装时,我们会看到错误消息“应用程序无法启动...应用程序配置不正确。”

把exe放到Depends.exe中,说:

Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\BENCHMARK.EXE" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\MYLIB-VC8.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

事件查看器日志:

Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system.

Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The referenced assembly is not installed on your system.

Generate Activation Context failed for C:\Program Files\MySoftware\vc8\Benchmark.exe. Reference error message: The operation completed successfully.

我已阅读将 msvcp80.dll、msvcr80.dll、msvcm80.dll 和 Microsoft.VC80.CRT.manifest 复制到应用程序文件夹就足够了。

我做错了什么?

【问题讨论】:

    标签: deployment visual-studio-2005 dll


    【解决方案1】:

    不建议复制 CRT dll。正如 Vinay 所说,您应该使用正确的合并模块。

    如果合并模块不适用于您的安装程序技术,您也可以使用 redist install exe:

    作为最后的手段,尝试将整个“Microsoft.VC80.CRT”目录复制到您的程序 exe 目录(不是内容,而是实际目录)。

    【讨论】:

      【解决方案2】:

      您并不真正需要 Microsoft 的 VC80 C 运行时库。真是一团糟。

      相反,使用 /MT 选项重新链接您的程序,该选项静态链接 c 运行时库 (libcmt.lib) 或 C++ 标准库。要通过项目属性进行设置,请转到

      C/C++ -> Code Generation -> Runtime Library: Multi-threaded (/MT)
      

      如果它无法编译,您可能还需要添加此选项 (/NODEFAULTLIB:)

      Linker -> Input -> Ignore Specific Library: msvcrt.lib
      

      查看来自http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx的链接选项

      【讨论】:

        【解决方案3】:

        在安装程序中选择 Visual Studio 2005 合并模块。 如果您使用安装了服务包的 Visual Studio 构建了 exe/dll,也会发生这种情况。

        【讨论】:

        • 我猜这不是一个选项,因为我们使用 Innosetup 作为我们的安装程序。
        【解决方案4】:

        我也有这个问题。我对 Microsoft 对我们这样做感到震惊。
        (我使用 VC6 构建了一个特定项目,然后当我还在构建机器上安装 2003 和 2005 时,它导致我的 VC6 构建出现问题。(我没有检查原始机器上的安装)显然链接器/编译器不知道它在做什么,导致我的可分发文件出现问题。然后我不得不向我的 120k exe 应用程序添加一个巨大的 redist 安装文件。该死的微软。

        MS 过去曾多次将其搞砸。

        http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2011-07-10
          • 2011-08-22
          • 2015-05-05
          • 2010-11-02
          • 2014-07-21
          • 2016-08-15
          • 2014-08-27
          相关资源
          最近更新 更多