应用程序无法启动...应用程序配置不正确 - VC ++ 2005运行时问题

时间:2008-11-05 15:28:25

标签: deployment visual-studio-2005 dll

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

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

我们的安装程序还将VC8 CRT运行时从C:\ Program \ 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复制到应用程序文件夹就足够了。

我做错了什么?

4 个答案:

答案 0 :(得分:5)

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

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

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

答案 1 :(得分:4)

您并不真正需要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

中的链接选项

答案 2 :(得分:2)

在安装程序中选择Visual Studio 2005 Merge模块。 如果您使用安装了Service Pack的visual studio构建了exe / dll,也会发生这种情况。

答案 3 :(得分:2)

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

MS过去几次搞砸了这个。

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

相关问题