Click here to Skip to main content
13,548,740 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked
Posted 15 Jun 2011
Licenced CPOL

How to Distribute C run-time (CRT) Libraries with Your Application

, 16 Jun 2011
Rate this:
Please Sign up or sign in to vote.
Some tips on available ways of distributing CRT DLLs with your Visual C++ application
My application doesn't start because of error message 'The application configuration is incorrect'. What do I do?

This error typically means your application can't load the correct C run-time libraries (CRT). This tip describes how to address this problem.

First of all, determine what DLL modules your application depends on. You can do this with the help of the Dependency Walker (depends.exe)[^] tool. Open your executable file with the depends.exe to see what CRT modules it depends on. Typically, these modules are msvcrXX.dll and msvcpXX.dll, where XX is the version number of your Visual Studio (for example, Visual Studio 2005 has version number 80).

Next, you need to determine the exact version of CRT libraries you use. Microsoft usually upgrades CRT version when releasing service packs and hot fixes for Visual Studio, so this step is very important. To determine the version of your CRT, do the following. In your Visual Studio window, click menu File->Open and open your executable module to view its embedded resources. In appeared window, click RT_MANIFEST folder to see the embedded manifest XML file. The version of CRT is defined by the version attribute. An example CRT manifest is presented below:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0"

processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

Next you should choose how to distribute the CRT files. There are two ways: either by installing a Visual C++ redistributable package or by installing the DLLs to application local folder (an application local folder is a folder that contains an executable application file). Below these two alternatives are described.

  1. You can download a Visual C++ Redistributable package from the Microsoft Download Center[^]. There are different packages for x86 and x64 architectures, choose the correct one. Also ensure the package has exactly the same version that your CRT manifest has. If version doesn't match, search again for the correct redistributable package. When the correct package is downloaded, you can include it into your application installer and install it with your software.

  2. You can copy CRT DLL files and Microsoft.VCXX.CRT.manifest file to your application folder, where XX is the version number. This is called a private installation, because these CRT DLLs won't be shared with other applications. This way may also reduce the size of your installer, because CRT DLLs usually take less space than a redistributable package. You can take the correct CRT DLL files from vcredist subfolder of your Visual Studio folder or from the Visual C++ redistributable package (it is installed to C:\WINDOWS\WinSxS directory).


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Russian Federation Russian Federation
I am a software developer currently living in Tomsk, Russia. I received a PhD degree in Computer Science from Tomsk Polytechnic University in 2010. I have been professionally developing C/C++ and PHP software since 2005. I like contributing to open-source and writing programming articles for popular web resources, like CodeProject. Besides writing, I love skiing and watching Formula-1.

You may also be interested in...


Comments and Discussions

GeneralWhat is the best solution when I have two modules in the sam... Pin
Mojoturner28-Jul-11 7:12
memberMojoturner28-Jul-11 7:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180515.1 | Last Updated 16 Jun 2011
Article Copyright 2011 by OlegKrivtsov
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid