This application has failed to start because the application configuration is incorrect.

October 13th, 2009 7 Commented

Lately, I wrote a BitTorrent application using Visual Studio 2008 (VS2008) express. When I tested it on different machines, I got an error message box (see below message).

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

I’m sure this problem had been an issue for most of us (programmers) who use VS2005 and VS2008. This issue is due to the missing manifest file which is required by Windows XP. This file contains metadata that describes side-by-side assemblies and side-by-side assembly dependencies.

There are two solutions to this problem.

The first solution is to make a static linking. However, this will make the executable file bigger.

  1. Open up the project’s Properties
  2. Change the Runtime Library property under C/C++ -> Code Generation property page from Multi-threaded DLL (/MD) to Multi-threaded (/MT).
  3. Recompile the application.


The second solution is to copy the manifest and DLL files and place it in the folder where the executable file resides. This solution is pretty good for performing quick test.

  1. Copy the DLL and manifest files from your Microsoft Visual Studio folder, for example
    …\Microsoft Visual Studio 8\VC\redist\x86\…
    to the local folder.
  2. You might want to check your application using DependencyWalker to know what DLLs are needed.


The third solution is to install the vcredist_<x86 or x64 or ia64>.exe depending on the operating system. This is the proper solution to ensure the dependencies are all installed.

  1. Microsoft Visual C++ 2005 Redistributable Package
    Package (x86) – {A49F249F-0C91-497F-86DF-B2585E8E76B7}
    Package (x64) – {6E8E85E8-CE4B-4FF5-91F7-04999C9FAE6A}
    Package (ia64) – {03ED71EA-F531-4927-AABD-1C31BCE8E187}

  2. Microsoft Visual C++ 2005 SP1 Redistributable Package
    Package (x86) – {7299052B-02A4-4627-81F2-1818DA5D550D}
    Package (x64) – {071C9B48-7C32-4621-A0AC-3F809523288F}
    Package (ia64) – {0F8FB34E-675E-42ED-850B-29D98C2ECE08}

  3. Microsoft Visual C++ 2005 SP1 ATL Security Update Redistributable Package
    Package (x86) – {837B34E3-7C30-493C-8F6A-2B0F04E2912C}
    Package (x64) – {6CE5BAE9-D3CA-4B99-891A-1DC6C118A5FC}
    Package (ia64) – {85025851-A784-46D8-950D-05CB3CA43A13}

  4. Microsoft Visual C++ 2008 Redistributable Package
    Package (x86) – {FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}
    Package (x64) – {350AA351-21FA-3270-8B7A-835434E766AD}
    Package (ia64) – {2B547B43-DB50-3139-9EBE-37D419E0F5FA}

  5. Microsoft Visual C++ 2008 SP1 Redistributable Package
    (x86) Package – {9A25302D-30C0-39D9-BD6F-21E6EC160475}
    (x64) Package – {8220EEFE-38CD-377E-8595-13398D740ACE}
    (ia64) Package – {5827ECE1-AEB0-328E-B813-6FC68622C1F9}

  6. Microsoft Visual C++ 2008 SP1 Redistributable Package ATL Security Update
    (x86) Package – {1F1C2DFC-2D24-3E06-BCB8-725134ADF989}
    (x64) Package – {4B6C7001-C7D6-3710-913E-5BC23FCE91E6}
    (ia64) Package – {977AD349-C2A8-39DD-9273-285C08987C7B}



Possibly related posts: (automatically generated)
  1. How-To: Build libtorrent DLL for Windows in C++
  2. Static Link Library (SLL) vs. Dynamic Link Library (DLL) in C/C++
  3. Memory Leak detection with Microsoft Visual C++ – Part 1

Tags:
, , ,

7 responses to “This application has failed to start because the application configuration is incorrect.”

  1. Demon says:

    I try the first method , after I changed Multi-threaded DLL (/MD) to Multi-threaded (/MT),another probelm happened ,the phenonmenon as follow:
    fatal error c1189:#error: Please use the /MD switch for _AFXDLL builds.
    Do yo know how to solve this problem?

  2. softz says:

    @Demon,
    You are using MFC right? If so, you have to also change the Use of MFC under General property page from Use MFC in a Shared DLL to Use MFC in a Shared Library. That will eliminate the _AFXDLL builds error.

  3. Demon says:

    Hi,softz,
    I cannot find the selection of “Use MFC in a Shared Library”,and I have tried to use all the selection under the Use of MFC,but the compile cannot pass.
    By the way ,I use the release mode.

  4. softz says:

    You can find the property here. Make sure is set to static library for the MFC (unless you are not using MFC at all).

  5. Demon says:

    Thanks for your information!
    Now I have solved the problem after I installed three files as follow:
    dotnetfx.exe;
    English_vcredist_x86.exe;
    WindowsInstaller-KB893803-v2-x86_JPN.exe.

  6. softz says:

    Ok, that is exactly like step 2, providing the systems with the DLL dependencies which comes with the vcredist. However, you’d need to do the same with every computer that going to use your application. So, you may need to handle that in your installation apps.

    As for the step one, every needed functions are compiled into the exe and hence, you don’t need those file. But probably, you left out some library which needed to be static (like MFC if since you are using AFXDLL preprocessor def) and that’s why /MD didn’t work.

    But again, glad to hear that you solve the problem. cheers.

  7. softz says:

    Due to various questions received in this area, I’ve added a third solution which is the simplest and a sure work method for the missing manifest and dll problem. Cheers :)

Leave a Reply

CommentLuv Enabled