简体   繁体   English

无法在测试香草机上测试视觉c exe

[英]Testing a visual c exe on a test vanilla machine don't start

This Application has failed to start because the application configuration is incorrect. 该应用程序启动失败,因为应用程序配置不正确。 Reinstalling the application may fix this problem. 重新安装该应用程序可能会解决此问题。

This is what I get when i try my debug file on a system without visual studio installed. 这是在没有安装Visual Studio的系统上尝试调试文件时得到的。 I tried to copy the Debug_NonRedist\\x86\\Microsoft.VC90.DebugCRT in the same folder as my exe, with no luck. 我试图将Debug_NonRedist \\ x86 \\ Microsoft.VC90.DebugCRT复制到与我的exe相同的文件夹中,但是没有运气。

  • dll in Microsoft.VC90.DebugCRT folder in exe folder. exe文件夹中Microsoft.VC90.DebugCRT文件夹中的dll。
  • dll in same exe folder and dll. dll位于同一exe文件夹和dll中。


I have installed "Microsoft Visual C++ 2008 Redistributable Package" too. 我也安装了“ Microsoft Visual C ++ 2008可再发行组件包”。

The debug CRT is not distributable. 调试CRT不可分发。 The "Microsoft Visual C++ 2008 Redistributable Package" does not include the debug CRT. “ Microsoft Visual C ++ 2008可再发行组件包”不包括调试CRT。 The application has an automatically generated manifest that is telling the OS to load the debug CRT from the SxS system. 该应用程序具有自动生成的清单,该清单告诉操作系统从SxS系统加载调试CRT。

See this CodeProject article for ways to use a private assembly so that your app uses the debug CRT dlls that you manually copy over to the other system. 有关使用私有程序集的方法,请参见此CodeProject文章 ,以便您的应用程序使用您手动复制到其他系统的调试CRT dll。

The simplest solution to do is to compile your exe with the CRT statically linked instead of dynamically linked. 最简单的解决方案是使用静态链接而不是动态链接的CRT编译exe。

Open your project with Visual Studio. 使用Visual Studio打开您的项目。

Select from the menu Project->Properties (or right click on the project and select "Properties: from the Solution Explorer). 从菜单中选择“项目”->“属性”(或右键单击该项目,然后从“解决方案资源管理器”中选择“属性:”)。

From the tabbed tree control: Configuration Properties : C/C++ : Code Generation 从选项卡式树控件中:配置属性:C / C ++:代码生成

Change the "Runtime library" setting from "Multi-threaded Debug DLL (/MDd)" to "Multi-threaded Debug (/MTd)" 将“运行库”设置从“多线程调试DLL(/ MDd)”更改为“多线程调试(/ MTd)”
Rebuild, recopy, and all shoudl be good 重建,重新复制,一切都应该很好


Otherwise, the other solution is to actually build an MSI that bundles the VC9 runtime bits. 否则,另一种解决方案是实际构建捆绑VC9运行时位的MSI。 Build a setup project that includes these MSM merge modules: 建立一个包含以下MSM合并模块的安装项目:

"C:\\Program Files\\Common Files\\Merge Modules\\Microsoft_VC90_DebugCRT_x86.msm" “ C:\\ Program Files \\ Common Files \\ Merge Modules \\ Microsoft_VC90_DebugCRT_x86.msm”
"C:\\Program Files\\Common Files\\Merge Modules\\policy_9_0_Microsoft_VC90_DebugCRT_x86.msm" “ C:\\ Program Files \\ Common Files \\ Merge Modules \\ policy_9_0_Microsoft_VC90_DebugCRT_x86.msm”

(If you are running 64bit, these files are in your "c:\\program files (x86)" directory.) (如果运行的是64位,则这些文件位于“ c:\\ program files(x86)”目录中。)


Finally, if this doesn't work, you probably got some other DLL (MFC?) that might need to be copied as well. 最后,如果这不起作用,则可能还有其他一些DLL(MFC?)也可能需要复制。 I believe when you get the "application configuration is incorrect" error, you can look at the System Event logs (Control Panel->Admin tools->Event Viewer). 我相信当您收到“应用程序配置不正确”错误时,可以查看系统事件日志(“控制面板”->“管理工具”->“事件查看器”)。 There is usually a detailed error message about the missing DLL. 通常,会有有关丢失的DLL的详细错误消息。

I would suggest making a release build and trying that on the vanilla machine (along with the Microsoft Visual C++ 2008 Redistributable Package installed on that machine), and see if that works. 我建议创建一个发布版本,并在普通计算机上尝试该版本(以及在该计算机上安装的Microsoft Visual C ++ 2008可再发行组件包),然后查看是否可行。

It is quite possible that your application also uses MFC and C++ DLLs that you might not have copied over. 您的应用程序很可能还使用了您可能尚未复制过的MFC和C ++ DLL。 ie MFC90D.DLL, MSVCR90D.DLL, MSVCP90D.DLL 即MFC90D.DLL,MSVCR90D.DLL,MSVCP90D.DLL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM