程序启动时“application configuration is incorrect”的解决办法

Error message when you try to run a Visual C++ application: "This application has failed to start because theapplication configuration is incorrect. Reinstalling the application may fix the problem"

Article ID: 948854 - View products that this article applies to.

当你的用VC开发的程序启动时,弹出“此程序启动因程序配置错误启动失败,重新安装或可解决问题。
可以参考MS网站Article ID: 948854 - View products that this article applies to.

SYMPTOMS: 症状

When you run a Visual C++ executable file or DLL that contains embedded debug information, the application does not start. Additionally, you receive the following error message:
运行VC的执行文件或DLL时,这些文件包含了调试信息。程序未能启动,会弹出如下信息:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.
此程序启动因程序配置错误启动失败,重新安装或可解决问题。
This problem occurs if the Microsoft Visual C++ Redistributable Package (VCRedist.exe) has been used to deploy Visual C++ DLLs on the computer.
此类问题的发生,是因此PC(注:当然是开发者用的了)用MS VC++的重发布包(VCRedist.exe)绑定了VC的DLL库。

CAUSE: 原因

This issue occurs when one of the following conditions is true:
以下之一的条件符合时,会发生此类情况:
  • The VCRedist.exe file that is installed is for a different version of Visual C++.
    所安装的VCRedist.exe和VC++版本不一致。
  • The VCRedist.exe file did not install the debug build of Visual C++ DLLs on the computer.
    VCRedist.exe未安装Debug版本的VC DLL.

RESOLUTION: 解决方案

To resolve this issue, you can use the Dependency Walker tool to document all the DLLs that a Visual C++ application uses. To do this, use the following methods in the order that they are presented.
要解决此问题,你可以使用“Dependency Walker”的工具来记录此程序所用的VC++ dll文件。如下述方法:

Method 1: Install the Dependency Walker tool
1. 安装Dependency Walker tool

The Dependency Walker tool is part of the Windows Support Tools. The Support Tools are not installed with the Windows operating system. Instead, you must install them separately from the \Support\Tools folder of the Windows operating system CD. To install Windows Support Tools, see the "Install Windows Support Tools" section of the following Microsoft Web site:
Dependency Walker tool是Windows的支援工具之一。这些工具并未随Windows安装,所以你需要在Windows OS CD上独立安装(参照\Support\Tools目录)。你也可以在MS官网上获取这个工具的有关章节。
http://technet2.microsoft.com/windowsserver/en/library/baa79cdd-83b0-4f10-9356-b2d14462d5b21033.mspx?mfr=true

Method 2: Determine which DLLs the application depends on
2. 检查这个程序依赖了哪些DLL文件

To determine which DLLs the application depends on, use the Dependency Walker tool to scan the Visual C++ application. To do this, follow these steps:
按以下步骤使用Dependency Walker tool来检查这个VC++程序所依赖的哪些DLL文件
  1. In Windows Explorer, locate the application and any DLLs that the application requires. 在文件浏览器中定位到这个程序以及所需要的DLL文件。
  2. Right-click the application, and then clickView Dependencies. 右击程序,选择“View Dependencies”。
Dependency Walker scans the application and builds a hierarchical tree that lists all the dependencies that the application has. One of the dependencies is the debug version of the C run-time libraries (CRT) that are being used, such as the Msvcr80d.dll file.
Dependency Walker 会扫描这个程序,并建立一个分级的树状列表来描述此程序的依赖关系。有一个依赖项则是CRT会被用到,诸如Msvcr80d.dll,它包含了调试信息(注意d字样)。

Method 3: Copy dependent DLL files
3. 拷贝这些被依赖的DLL文件

If an older version of the debug version of the CRT is installed, or if the files are not present on the computer, you must provide copies of the debug version of the CRT that was used to build the Visual C++ application. To do this, follow these steps:
  1. On the development computer, locate the debug version of the CRT. This version is located in the following Visual Studio folder:
    ..\VC\redist\Debug_NonRedist
  2. Copy the necessary DLL file assemblies from this folder.
  3. On the computer on which you want to run the application, copy the DLL file assemblies into a folder that has the same name and path under the folder for the Visual C++ application.
Important The debug version of the CRT DLLs are not redistributable. We do not recommend that you deploy these to end-users for a released deployment of the application. For more information about redistributable files, see the Redist.txt file in the root folder of your Visual Studio installation.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值