简体   繁体   中英

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. I tried to copy the Debug_NonRedist\\x86\\Microsoft.VC90.DebugCRT in the same folder as my exe, with no luck.

  • dll in Microsoft.VC90.DebugCRT folder in exe folder.
  • dll in same exe folder and dll.


I have installed "Microsoft Visual C++ 2008 Redistributable Package" too.

The debug CRT is not distributable. The "Microsoft Visual C++ 2008 Redistributable Package" does not include the debug CRT. The application has an automatically generated manifest that is telling the OS to load the debug CRT from the SxS system.

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.

The simplest solution to do is to compile your exe with the CRT statically linked instead of dynamically linked.

Open your project with 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

Change the "Runtime library" setting from "Multi-threaded Debug DLL (/MDd)" to "Multi-threaded Debug (/MTd)"
Rebuild, recopy, and all shoudl be good


Otherwise, the other solution is to actually build an MSI that bundles the VC9 runtime bits. Build a setup project that includes these MSM merge modules:

"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"

(If you are running 64bit, these files are in your "c:\\program files (x86)" directory.)


Finally, if this doesn't work, you probably got some other DLL (MFC?) that might need to be copied as well. 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.

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.

It is quite possible that your application also uses MFC and C++ DLLs that you might not have copied over. ie MFC90D.DLL, MSVCR90D.DLL, MSVCP90D.DLL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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