none
Running a very simple Win32 app on a comp without VC++ 2005 Express

    Question

  • Hi!

    I have installed VC++ 2005 Express and the Platform SDK according to the instructions on MSDN:
    http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
    Compiling and running the following program on the dev computer works like a charm:
    http://www.winprog.org/tutorial/simple_window.html

    I then changed to release-mode, turned off debugging in the project properties and copied the .exe to another computer without VC++ 2005 Express on. I pretty much expected problems, so I wasn't very surprised when I got the error message saying that there was something wrong with the program configuration, like the one here:
    http://forums.microsoft.com/msdn/showpost.aspx?postid=23371&siteid=1

    I have since then combed this forum and eventually found a number of different posts containing instructions how to deploy correctly, examples of these are:
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54317&SiteID=1
    http://forums.microsoft.com/msdn/showpost.aspx?postid=75707&siteid=1
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=156255&SiteID=1
    I have also read about "Redistributing Visual C++ Files" on msdn:
    http://msdn2.microsoft.com/en-us/library/ms235299.aspx

    None(!) of these seems to do it for me, I suspect that this is mostly because the above examples does not deal with the Express-version, but I'm not sure.

    For someone pretty new to the VS-environment it is a nightmare, so far, to find out how to go about to deploy the applications correctly.

    Therefore, I would deeply appreciate it if someone could give a straight-up and complete guide on how to get this application (see the beginning of this post) to run on another computer (the one I have is running WinXP SP2, but if there's any difference in the approach when it's supposed to run on Win98-Win2K then please explain that as well). I know this is a lot to ask, but you will have my eternal thanks :).
    Saturday, December 10, 2005 9:13 PM

Answers

  • OK, due to popular demand, and my frustration with seeing so many people using Express that simply want to run an app on another machine, without the hassle of learning about merge modules, Windows Installer, etc, etc, etc, here is a way to perform deployment option number 2 above (i.e. installing C Runtime library applocal) for Express.

    1) On the machine you have Express installed, create the following folder and subfolders in your
    \program files\microsoft visual studio 8\VC folder:

    redist\x86\Microsoft.VC80.CRT

    2) Copy msvcr80.dll, msvcp80.dll, msvcm80.dll from
    \windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd

    into:

    \program files\microsoft visual studio 8\VC\redist\x86\Microsoft.VC80.CRT

    3) in the above Microsoft.VC80.CRT folder, create a new file named:

    Microsoft.VC80.CRT.manifest

    4) Paste the following content into the above manifest file:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright © 1981-2001 Microsoft Corporation -->
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <noInheritable/>
        <assemblyIdentity
            type="win32"
            name="Microsoft.VC80.CRT"
            version="8.0.50608.0"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b"
        />
        <file name="msvcr80.dll"/>
        <file name="msvcp80.dll"/>
        <file name="msvcm80.dll"/>
    </assembly>

    Now you have a new folder in your Visual C++ Express installation that can be re-used when ever you need it.

    To deploy these files, simply copy the Microsoft.VC80.CRT folder you just created to your program folder.  That's it.  So for example, if your application executable resides in C:\Program Files\MyApp, you'll have a folder named:

    C:\Program Files\MyApp\Microsoft.VC80.CRT

    that contains the 4 files I mentioned (3 DLLs and one manifest file you created by hand)

    No installation of anything else is necessary.  Just click on your EXE file, and your app will run.  No special installation engines are necessary, just make your setup program (installer) create that subfolder Microsoft.VC80.CRT along with what you normally install with your app)

    Let me know if you need similar instructions for MFC and I'll create them. 

    Sunday, December 11, 2005 5:28 PM
  • The proper way is to use vcredist_x86.exe.  More details are mentioned at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=149470&SiteID=1 or to just link statically to the CRT using the /MT compiler switch.

    For more info, please see:
    http://msdn2.microsoft.com/en-us/library/ms235624.aspx
    http://msdn2.microsoft.com/en-us/library/zebw5zk9.aspx


    Thanks,
      Ayman Shoukry
      VC++ Team
    Sunday, December 11, 2005 1:14 AM
  • to all those reading this thread and are trying to run RELEASE versions of your software (not debug): 

     

    forget about all other methods.  Download and install both of these and all problems will go away:

     

    non SP1 version

    http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en

     

    SP1 version:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

    Thursday, May 17, 2007 6:58 PM

All replies

  • The proper way is to use vcredist_x86.exe.  More details are mentioned at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=149470&SiteID=1 or to just link statically to the CRT using the /MT compiler switch.

    For more info, please see:
    http://msdn2.microsoft.com/en-us/library/ms235624.aspx
    http://msdn2.microsoft.com/en-us/library/zebw5zk9.aspx


    Thanks,
      Ayman Shoukry
      VC++ Team
    Sunday, December 11, 2005 1:14 AM
  • But he's using Express which doesn't even come with a vcredist_x86.exe.  The only way with Express is using the merge modules that come with Express in the folder:

    \program files\common files\merge Modules

    plus ensuring that Windows Installer 3.x engine is available on the user's machine, and if it's not, installing that as well. 

    The two methods that work with something higher than Express, are:

    1) using vcredist_x86 in:

    C:\program files\microsoft visual studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86

    plus ensuring that Windows Installer 3.x engine is available on the user's machine, and if it's not, installing that as well. 

    2) Copying these folders to your program folder (keeping the sub folder names):
    \program files\microsoft visual studio 8\VC\redist\x86

    Sunday, December 11, 2005 4:37 PM
  • OK, due to popular demand, and my frustration with seeing so many people using Express that simply want to run an app on another machine, without the hassle of learning about merge modules, Windows Installer, etc, etc, etc, here is a way to perform deployment option number 2 above (i.e. installing C Runtime library applocal) for Express.

    1) On the machine you have Express installed, create the following folder and subfolders in your
    \program files\microsoft visual studio 8\VC folder:

    redist\x86\Microsoft.VC80.CRT

    2) Copy msvcr80.dll, msvcp80.dll, msvcm80.dll from
    \windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd

    into:

    \program files\microsoft visual studio 8\VC\redist\x86\Microsoft.VC80.CRT

    3) in the above Microsoft.VC80.CRT folder, create a new file named:

    Microsoft.VC80.CRT.manifest

    4) Paste the following content into the above manifest file:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright © 1981-2001 Microsoft Corporation -->
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <noInheritable/>
        <assemblyIdentity
            type="win32"
            name="Microsoft.VC80.CRT"
            version="8.0.50608.0"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b"
        />
        <file name="msvcr80.dll"/>
        <file name="msvcp80.dll"/>
        <file name="msvcm80.dll"/>
    </assembly>

    Now you have a new folder in your Visual C++ Express installation that can be re-used when ever you need it.

    To deploy these files, simply copy the Microsoft.VC80.CRT folder you just created to your program folder.  That's it.  So for example, if your application executable resides in C:\Program Files\MyApp, you'll have a folder named:

    C:\Program Files\MyApp\Microsoft.VC80.CRT

    that contains the 4 files I mentioned (3 DLLs and one manifest file you created by hand)

    No installation of anything else is necessary.  Just click on your EXE file, and your app will run.  No special installation engines are necessary, just make your setup program (installer) create that subfolder Microsoft.VC80.CRT along with what you normally install with your app)

    Let me know if you need similar instructions for MFC and I'll create them. 

    Sunday, December 11, 2005 5:28 PM
  • Thank you VERY much Ted, an explanation like yours was exactly what I was looking for, and it worked perfectly :).
    Monday, December 12, 2005 7:43 PM
  • This procedure did not seem to work for me where I have a single DLL with an embedded manifest which is called from Java via JNI.  I put the Microsoft.VC80.CRT subdirectory in the same location as the dll.  Any ideas?
    Monday, December 12, 2005 8:10 PM
  • Andreas, good to hear.  I wish they would've include those files in the default Express installations.

    hathawa, I don't know how applocal installation is supposed to work in cases where you have no control over the main executable (i.e. you can only just put the manifest in the DLL and not the executable file)  I'll have to research that some more. 
    Monday, December 12, 2005 9:27 PM
  • Dear Ted,

    thanks for the information you provided for copying CRT files.
    I want to do same for MFC based application also and I followed similar step for

    Microsoft.VC80.MFC
    Microsoft.Tools.VisualCPlusPlus.Runtime-Libraries

    copying dlls in them and creating a manifest file which I copied and modified from winsxs\manifests but still my application is not working on a machine with no visual studio 2005. Did I miss something? can you please provide step for doing same.

    thanks,
    Saurabh
    Tuesday, December 13, 2005 5:51 AM
  • For Microsoft.VC80.MFC after copying the manifest please open it up in notepad and change the version to 8.0.50608.0 

    I just tried on my test machine and it worked.  Can you tell me what error you got?  Try using dependency walker to see if it picks up the DLLs.

    For the other one you mentioned I don't think you need it or require for your app if it's a 2005 app. It's for apps written in Visual C++ 6.0.    I woudn't recommend manifest for those DLLs if you require them.  Just copy them to system32 folder.

    Ted.
    Tuesday, December 13, 2005 2:22 PM
  • Hi everybody;

    With regards to the Windows Installer in this version of VC++ Express,... well, how?

    Whilst the one simple walkthrough that I found in the MSDN does, admittedly, state that menus and dialogues may differ dependant on settings, the 'Add New Project' dialog box that I see only contains the "Visual C++"    'node', as the walkthrough puts it, as opposed to the "Other Project Types" node mentioned there.

    What have I not installed, or what am I doing wrong, or where do I need to look?!

    Any help would be much appreciated!

    Thanks

    Tuesday, February 21, 2006 8:53 PM
  • I just install VC++ 2005 Express this week to make use of the new SerialPort class in MFC and am having a couple fo deployment problems. I have had my user install the framework redistributable for 2.0.

    These problems are new to VC++ 2005 Express.

    1. An attempt to execute the Debug version of the execuatbles give the "not properly configured" error. I have tried the dll and manifest copying trick recommended to no avail.

    2. Execution of the Release version of the executables causes a failure in teh SerialPort ReadExisting call in which all of the data is received as question marks (?). I saw this problem during development and the fix was to add an access to property BytesToRead before making the ReadExisting call. WHile that didn't make any sense to me at the time, it worked - but now it isn't

    Friday, May 05, 2006 3:33 PM
  • Bob Lane for debug versions just create a text file named:

    Microsoft.VC80.DebugCRT.manifest

    with the following contents:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright © 1981-2001 Microsoft Corporation -->
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <noInheritable/>
        <assemblyIdentity
            type="win32"
            name="Microsoft.VC80.DebugCRT"
            version="8.0.50608.0"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b"
        />
        <file name="msvcr80d.dll"/>
        <file name="msvcp80d.dll"/>
        <file name="msvcm80d.dll"/>
    </assembly>

    Then copy this file as well as the 3 files mentioned in the manifest to the folder where your program or DLL resides. 

    Do the same for MFC: create a text file named Microsoft.VC80.DebugMFC.manifest and copy the following contents in there:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright © 1981-2001 Microsoft Corporation -->
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <noInheritable/>
        <assemblyIdentity
            type="win32"
            name="Microsoft.VC80.DebugMFC"
            version="8.0.50608.0"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b"
        />
        <file name="mfc80d.dll"/>
        <file name="mfc80ud.dll"/>
        <file name="mfcm80d.dll"/>
        <file name="mfcm80ud.dll"/>
    </assembly>

    Then copy this manifest plus the 4 DLLs mentioned to the same folder where your program or DLL resides.

    It's that simple.

     

    Saturday, May 06, 2006 2:38 AM
  • Ted, unfortunately, I am unable to locate the mfc*80d.dll files. Are you sure those are the right file names?
    Wednesday, May 10, 2006 2:09 PM
  • Hi Bob, sorry, I didn't realize that it was VC++ Express.  You can't even compile an MFC application using Express (it's not supported) so no debug nor release versions of MFC DLLs are included with Visual C++ Express.  Under what situation are you finding that you require debug versions of MFC, if you can't even compile an app using MFC?

    As MFC doesn't come with Express, Is it possible you're trying to use the MFC version that came with the Platform SDK? If so the only way around that would be to compile MFC as a static library (this is non-trivial)

    Wednesday, May 10, 2006 3:01 PM
  • OK, now I'm getting lost. I'll tell you how I got where I am and maybe you can help me find the way out of the woods.

    I have a Visual C++.net, version 2003, that uses Framework V1.1. I was having some problems the access to the serial port drivers availabe in Platform SDK, so I found that Framework v2.0 had the class for that object. But since VC++ 2003 does not work with Framework 2.0, I installed VC++ Express along with the new Framework.

    I subsequently implemented the access to the SerialPort class and got everything working, with one minor exception. The app would throw an exception (nullReferenceException) when compiled in Release mode. This did not occur in Debug mode. I have yet to determine why that is.

    When I copied the executables (both release and debug) to another computer, the release version got the same exception (along with errors in the serial port access - yet another problem), but the debug version would not start because of the "invalid configuration" error. BTW, that computer has the redistribution copy of Framework 2.0 installed.

    As an added piece of information, I have just installed VC++ Express and Platform SDK on a third computer and the debug version is working. The release version still gets the nullReferenceException.

    Wednesday, May 10, 2006 9:05 PM
  • Now that I re-read your original, I understand where I went wrong - the SerialPort class has nothing to do with MFC - it's part of the .NET Framework 2.0.  So you don't need MFC at all. All you need to ensure is that the .NET Framework 2.0 redist is installed.  So this is off topic to the original thread (as it deals with Win32 apps not .NET Framework based apps)

    If you copy a debug app to another computer then you need debug versions of the C Runtime Library installed there's no way around that.    The easiest way is to just install the entire development environment again on that computer. 

    To solve your problem, you will have to debug your release app to see why it's causing an exception (step through in the debugger). It likely has nothing to do with redistributables and such, and is probably a legitimate bug in the code that only shows up in the release version of your app (I've had many of these over the years)

    Thursday, May 11, 2006 1:19 PM
  • Ted, thanx allot for sticky with me. I learning. I will solve my bug problem and stay away from distributing debug versions.
    Thursday, May 11, 2006 1:49 PM
  • Nope. Now I get Runtime error! Program C...
    R6034
    An application has made an attempt to load the C runtime library incorrectly.
    Please contact the application's support team for more information.

    ahhhhhhhhhhhhhh...
    Thursday, June 08, 2006 5:09 AM
  • Thanks for the advice Ted,

    Unfortunately, I have followed these directions with Express and I have a


    new issue, when I run the executable, I get this message in a pop-up error window:

    "The procedure entry point_encode_pointer could not be located in the dynamic link library MSVCR80.dll."

    As far as I know, I have the most recent version of MSVCR80.dll, if there is more than 1 version.

    Additionally, I used the dependency checker (depends.exe) and it show grief with two other functions (three total):

     

    _decode_pointer

    _encode_pointer

    _except_handler4_common

     

    Has any else had this same issue and resolved it?  Any help is appreciated Ted, if you are still monitoring this thread.

    Thanks,

    Ryan

    Thursday, July 27, 2006 3:46 PM
  • Where does depends.exe show msvcr80.dll is located and also what is the version of the dll?
    Thursday, July 27, 2006 4:20 PM
  • It says it is located in the sub directory of 'Microsoft.VC80.CRT', and the version number is 8.0.50215.44.
    Thursday, July 27, 2006 6:00 PM
  • This is not an officially released version of msvcr80.dll (I suspect it may be a beta-release). Did you get it from here? If so then I suggest that you re-install Visual C++ Express to ensure that you get the correct version. Note: the link I provided has comments from Martyn Lovell from the Visual C++ team explaining why you shouldn't use this version of the DLL.
    Thursday, July 27, 2006 7:59 PM
  • Awesome, thanks for the quick reply, that looks like the problem to me, I'll have to check tomorrow on my target computer to be sure, I'll come back if I have any more problems. I hope that helps anyone else who got the wrong dll file. I also found that the same file is on several different dll download sites.

    Once again, thanks!
    -Ryan

    Thursday, July 27, 2006 10:23 PM
  • Oh boy, I am sitting here bemused. It never fails that Microsoft changes the paradigm of development with each release of Visual Studio. Now we have manifests to deal with. Oh joy.

     

    I’m new to Visual Studio 2005 Professional, and am using it in updating my Augmentative and Assistive Communication product, Xpress-It. Xpress-It is your typical MDI app invoking various DLLs as it initializes, including some rather venerable ones. Xpress-It currently depends on the version of InstallShield that came with VS 6. Obviously, I am now compelled to update all of that. I’d think that VS 2005 Pro would have something to automatically build the manifest. After all, the environment knows every file the app is grabbing during initialization, And then there’s the next step, which I take to be building a MSI package. I don’t remember if those date back to Windows 98, but Xpress-It has to stay backwardly compatible at least that far.

     

    Oui vey. What I seem to need is for someone to offer some guidance. I need to know what steps are involved in creating a tidy installation package with backwards compatibility. This installation does involve creating an ODBC connection to an included database so I strongly suspect I’ll have to see some working examples.

     

    We can always count on Microsoft to keep us guessing, huh?

    Tuesday, August 29, 2006 1:06 AM
  • Ted,

     

    Excellent, excellent, excellent !!!

    I know your post is old but it worked for me. I thought I was losing my mind. ;)

    Anyways, if it is possible, can you post a sample for the .NET installation sample ?

     

    Thanks in advance,

    gxo

    Thursday, October 26, 2006 3:58 PM
  • Can you be more specific as to what you mean by ".NET installation sample"? 

    The .NET 2.0 framework runtime is a redistributable component that is downloadable from Microsoft downloads. 

    http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en

    Thursday, October 26, 2006 8:26 PM
  • Ted,

     

    Thanks for the response. What I meant is: can I make a stand alone *.exe windows form application without all the hassles of downloading and installings .NET 1.1/2.0 stuff on the target PC. Is it possible to create something like Microsoft.VC80.NET.manifest ???

     

    Thanks in advance,

    gxo

    Friday, October 27, 2006 2:26 PM
  • hi gxo, no this is not possible.  You must have a .NET Framework installed on the target PC, and it must be installed properly (i.e. using the redistributable with any necessary language packs).   This is one of the reasons why some people stick with unmanaged development - they don't want to be dependent on the .NET Framework engine.
    Friday, October 27, 2006 3:18 PM
  • Hi!

    I'm not quite sure that this is exactly the problem I'm facing right now, so I'm just making sure...

    I upgraded to MS VS2005pro and continued working on the latest release of my app. Now I released a few Beta-Installations just the way I always did. Obvioulsly some (maybe all; don't know yet) of my customers run into this "application configuration incorrect"-problem. Will the cure described above help me as well?

    I'm using VS 2005pro, MFC and I'm linking the libs staticly.

    I'm stuck, please help ;-)

    Nils

    Wednesday, November 08, 2006 12:58 PM
  • If you're linking statically then yours is not the same problem.  You should have no dependencies on any CRT and MFC files.  Are you sure all your EXEs and DLLs are linking statically?
    Wednesday, November 08, 2006 4:23 PM
  • Is there a tool to examine my EXE to find out?
    Thursday, November 09, 2006 6:06 AM
  • Yes, you can use dependency walker (depends.exe) , it should be found here on your machine:

    \Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin

     

    Thursday, November 09, 2006 1:06 PM
  • Hi!

    I used depends.exe and got a lot of information that doesn't really tell me too much (lots of DLLs that depends on others etc.).

    So I assumed (beacause I don't know) that not ALL libs are linked statically and tried your work-around. Since the required directories, DLLs and manifests are already there, I just copied the ones for VC and MFC into my app-directory; and it seems to work (app still crashes immediatly, but this may have other causes).

    So this particular problem seems to be solved, however one question remains:

    How am I supposed to know that after upgrading to VS2005 I need to do such things to get my app deployed? Or: Why doesn't the installer take care of this?

    Thanks for your help!!

     

    Nils  

    Sunday, November 12, 2006 10:11 AM
  • Hi Ted!

    Yet another question:

    I included the two above mentioned folders (VC & MFC) into my installer package. This automatically makes the install dependent on the .NET-Framework (although I don't use it). Also, when place these two folders into the Filesystem of my installer package I get the following request from the IDE: "These files are already available in C:\......., would you like to include the merge-modules instaed?". What should I do? What does it mean?

    Please bring some light into this darkness ;-)

    Nils

    Sunday, November 12, 2006 11:26 AM
  • Some of the stuff related to this issue are in the documentation. 

    There are many different ways to deploy a native app.  You can read up about it here:

    deployment (general concepts):

    http://msdn2.microsoft.com/en-us/library/zebw5zk9(VS.80).aspx

    choosing deployment method:

    http://msdn2.microsoft.com/en-us/library/ms235316(VS.80).aspx

    using setup and deployment:

    http://msdn2.microsoft.com/en-us/library/ms235317(VS.80).aspx

    using xcopy:

    http://msdn2.microsoft.com/en-us/library/ms235291(VS.80).aspx

     

     

    Monday, November 13, 2006 8:08 PM
  • No, it doesn't.  Your MFC application should not be dependent on the .NET Framework if you do not use it.

    I'm not sure where you get this message, but I agree that using the merge modules are a better way to distribute the software (see my last post above for more info)

    Monday, November 13, 2006 8:11 PM
  • Hi Ted,

    Your step by step instructions ALMOST fixed my issue.  It got the application to give another error at least, instead of the original infamous one.  I followed the Debug mode instructions and now when I run the app it gives:

    The application failed to initialize properly (0xc0000034).  Click on OK to terminate the application.

    This app works just fine on the programmers computer but wont work on mine.  I was quite pleased however that your step by step guide was able to at least remove the first error.  Any suggestions on what to do next?

    thanks
    Robert
    Saturday, December 16, 2006 4:14 PM
  • In the meantime, Im going to install the visual c++ express sdk just to see if it helps matters at all.  Unfortuneatly the programmer is unavailable to help troubleshoot at the moment and this is very urgent, I will reply again with the outcome of installing the full sdk, Im hoping it will miraculously fix the issue.  thanks
    Saturday, December 16, 2006 4:39 PM
  • Well, installing .net 2.0 and the visual express SDK indeed made it so the app would finally run.  However now it just crashes further in but at least it no longer seems to be a setup issue with .dlls and such.  Ill have our programmers check out this thread for information, thanks Ted for posting the info. 

    Robert
    Saturday, December 16, 2006 4:52 PM
  •  

    Monday, January 01, 2007 10:05 AM
  • Hi, I'm having pretty much the same problem as everyone else is with VC++ Express Edition.  I can't get an application to run on a different PC. I've tried using the solution Nikola Dudar listed, very carefully follow every step, and that failed to work for me, then I tried Ted's solution and that failed to work for me as well.

    I need to ask if there is anything I missed such as if I am supposed to build the application differently or something to get it to work as it seems everyone else has positive feedback that these solutions are effective whereas I can't seem to get past the error message that claims the application is configured incorrectly.

    Any help would be deeply appreciated.


    I think I would appreciated it most if someone told me how I could just make everything statically linked in VC++ EE.  I have a feeling being non-dependent on the .NET framework is the only choice I have for the project I'm working on.
    Wednesday, January 10, 2007 7:38 AM
  • hi codeninja, my guess is that you are attempting to run a "debug" version of your app on a different PC instead of the "release" version.  On one of the toolbars in the IDE there should be a dropdown list that says "Debug" on it.  Just change that to "Release" and then rebuild your app.  The instructions I gave will work with "release" builds only (without SP1 installed - if you have SP1 then the version in the manifest file needs to be changed from 8.0.50608.0 to 8.0.50727.763 and then SP1 versions of the libraries need to be copied instead of the originals)
    Thursday, January 11, 2007 3:07 PM
  • -----You can't even compile an MFC application using Express (it's not supported)

    This is not correct! If you have say.. Visual studio 7.0 or another ms product... I think you can also legally compile software with Express... (I think Iegally)

    I did! (I used the mfc 8.0 from vs Beta 2)

    Thursday, January 11, 2007 7:39 PM
  • Thankyou very much Ted :D

    Sorry for asking such a newbie question but that did allow it to work.... Even so it still requires that the .Net framework be installed.... Shouldn't microsoft have all of these files in a service pack or something? But anyways turns out VC# 2005 EE applications run perfectly without a hitch on other PCs.... which is a shame cause I really really like c++

    Ah well my problems are solved either way so thank you very much Ted.
    Friday, January 12, 2007 5:32 AM
  • Great work Ted!!

    I just simply want to remark a little confussion I had at the time to write down the manifest file: the version number of the msvcx80.dll is 8.0.50727.42 but in the manifest file you NEED to write version="8.0.50608.0"  because if I use the other one it fails...., I don't understand this fact but letting the things like that (with two different version number in the manifest file) everything works fine.

    Thanks

    Mario

    Wednesday, January 24, 2007 2:59 PM
  • Ted, one more thing about VC2005 EE. How in the earth did I get stacked with .Net if I only want to write a simple application for Windows?. I used VC2005 EE for building some samples as Amcap (DirectX/DirectShow sample) and also CaptureSound (DirectX/DirecSound sample). I modified these samples for my purpose and can run the executables files in others machines without problems. None of those machines have .Net framework installed of course. Also I made form the scratch a CLR/console application without problems fo distribution. Now I start a new project of makefile type because I want to use Qt graphics capabilities and all this troubles came along. I am affraid I have told to the IDE (somewhere..) to use .Net??. Excuse me but I am newbie so I need an advice. When I start a new project from the scratch, what kind of options should I avoid for not use .Net framework?.
    Wednesday, January 24, 2007 3:22 PM
  • That was very helpful, unfortunately this didn't help me.  I am running VS8.0 Pro edition, and I still am unable to generate the simple task of making a portable executable.  It seems that what used to be a simple C compiler is now back to the days of VB when you needed to tag a bunch of dll files around with your executable because of compiler limitations.

    My dilemma is similar -- I spent a few days making a simple program, and now I have to actually deliver to the customer, and I find out it only works on the specific computer that the program is built on.  Perhaps I should have bundled VS8.0 with the sale of the product.  Bad enough it doesn't build on VS 7.0, or that the compiler flags have gotten so complicated that I can't get a release version out, but how do I get my executable to my customer!!!

    So, what is listed as "the solution" for this problem has no effect on the ability for me to be able to execute my program on another system.  I have three systems, all with VS8 (Pro), and I had to build on each system for them to be able to execute.  My question, is there a way to get more information to help indicate what the actual problem is?  Is there any way to get an executable out of VS8 that is self-contained enough to execute wherever I want?  I want an executable file, not a set of files I need to build and manage an installation for.

    With VS8 pro, the dll files listed above were already in the appointed place, and the manifest was identical to the one listed above, so I just zipped it up and plopped it in the directory where my exe was, and voila, I get the same error message as before. "This application has failed to start because the application configuration is incorrect.  Reinstalling the application may fix this problem."

    Any help would be great -- sorry for any misdirected sarcasm.  I am just a bit frustrated.

    Thanks,

    -Kevin

    Friday, February 16, 2007 5:20 PM
  • This is my manifest:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
        </dependentAssembly>
      </dependency>
    </assembly>

    Does anyone have any idea why it's putting two different versions of the CRT library in the manifest?  This is VS2005 with SP1.  When I delete the reference to the old version (i.e. 50608), deployment works fine.

    Thursday, March 01, 2007 3:16 AM
  • You probably are linking to a static library that was built with a version of VC 2005 prior to SP1.  I made the same mistake early on, but then realized that all static libraries (under my control) must be rebuilt with SP1.
    Thursday, March 01, 2007 6:26 PM
  • What do you do if it's not under your control?  Are you forced to use something like _USE_RTM_VERSION at that point until the library provider recompiles?
    Thursday, March 01, 2007 6:38 PM
  • Yes, that's correct.  But a quick warning, _USE_RTM_VERSION doesn't work properly with MFC DLLs.   I brought it to their attention but alas, any further fixes to _USE_RTM_VERSION were rejected:

    http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=247057

     

    Thursday, March 01, 2007 9:17 PM
  • For now un-insatll current express and re-install from web site again to go BACK to lower build number of express

    this workd for me...for now

    Monday, March 05, 2007 7:22 PM
  • Hi Ted,

    Thanks, for this very clear explanation. However, I'm still wondering whether it's allowed to distribute these files with a commercial application because they are included neither in the redist directory nor in the NoRedist directory.

    Thanks in advance,

    Tuesday, March 06, 2007 12:18 PM
  • I have been having trouble with deploying my VC ++ Express Edition applications also.  I followed all of the steps that where mentioned in your post and still have not been able to get my application to run!
    Thursday, May 17, 2007 3:52 PM
  •  Hi TED, 

    I just posted a message concerning the method you described to distribute applications written with Visual C++ Express Edition.  I am new to the forum and was not sure my message posted.  However, even after performing all of the steps  I can not get my application to run.  Any suggustions?

    Thursday, May 17, 2007 4:02 PM
  • to all those reading this thread and are trying to run RELEASE versions of your software (not debug): 

     

    forget about all other methods.  Download and install both of these and all problems will go away:

     

    non SP1 version

    http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en

     

    SP1 version:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

    Thursday, May 17, 2007 6:58 PM
  • I have the same problem in combination with Java WebStart. I got it working on my development computer by putting a manifest file named javaw.exe in the bin directory of the java runtime environment. The contents of the file are similar to the one mentioned above. In addition I had to include msvcr80.dll and a manifest file named Microsoft.VC80.CRT.manifest with similar contents in the .jar file containing the native libraries of the WebStart application. Unfortunately it does not yet work on computers without VC++ Express. I am still struggling. Can anybody give me a hint?
    Wednesday, June 06, 2007 4:03 PM
  • Thanx TED and everyone on this thread.. It helped a lot. I was facing  similar problem and tried everything mentioned here.

    I have a simple solution for VC express users.. Try changing debug mode to Release in configuration and try compiling the file.

    It solved my problem

    Thanx again..!!

     

    ~SS

    Thursday, June 21, 2007 10:55 PM
  • My program is using 2 VC++ DLLs.

    one.dll is calling two.dll.

    It working fine on my computer.

    But it is not working on the target computer. I have to paste this two.dll in the c:\windows\system32 folder.

    Then it is working.

     

    Can anyone elaborate on what all changes I have to make in the manifest setting so that it will pick up the two.dll from the same application folder where one.dll is present.

     

    Tuesday, July 17, 2007 7:10 AM
  • I had the same problem. Just needed to install the latest

    Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)

    File Name: vcredist_x86.exe
    Version: 8.0.50727.762 Date
    Published: 4/10/2007
    Language: English Download Size: 2.6 MB

    http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en



    Hope this helps.




    Friday, August 03, 2007 8:58 PM
  • Ted, thanks, this worked for me for running my app on a system running winXP.  But I tried running the same procedure running my app on a system running Windows NT 4.0 and I get the following error message:  "The procedure entry point GetLocalPathName could not be located in the dynamic link library Kernel32.dll".  I need to run this on systems which are running NT 4.0.  Would greatly appreciate anyone's help.  Thanks.

     

    Monday, October 01, 2007 11:20 PM
  • Arun5000, you'll need to upgrade to a version of Visual C++ 2005 that supports static linking to the CRT, or you can try rebuilding the CRT libraries using these instructions

     

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=146362&SiteID=1

    Wednesday, October 03, 2007 7:03 PM
  • Using Visual C++ 2008 Express with the Windows SDK (previously known as the PSDK)

     

    Read this forum post for a description of what you need to do to build Win32 applications using Visual C++ Express and the Windows SDK for Windows Server 2008 and .NET Framework 3.5.  A more detailed explanation including screenshots can be found here.

     

    With the Visual Studio 2008 Express versions you can build Win32 applications right out of the box.  You no longer have to manually integrate the Windows SDK content with VC++ Express.

     

    The Visual Studio 2008 editions are seamlessly integrated with the Windows SDK.  VS2008 editions include the same Vista RTM headers and libraries that shipped in the Microsoft Windows  Software Development Kit Update for Windows Vista released in March, 2007. The SDK tools included with VS2008 editions are more recent than those that ship in the Vista Update SDK and the Windows Server 2003 Platform SDK.

     

    If you install another SDK, such as the Windows SDK for Windows Server 2008 and .NET Framework 3.5 after you install VS, you are ready to develop with the headers, libraries and tools in the SDK for Windows Server 2008.  Read this forum post if you installed the SDK before installing Visual Studio.  (It’s easy to switch back if you want.) 

     

          K a r i n   M e i e r

    Windows SDK | Samples & Community PM

    http://blogs.msdn.com/KarinM

     

    Friday, February 22, 2008 6:31 AM
  • Hi,

    Just go through the link below.....
    http://blogs.msdn.com/jreddy/archive/2005/12/23/troubleshooting-c-c-isolated-applications-and-side-by-side-assemblies-scenario-based-with-solutions.aspx

    I solved my problem by chaning the version number as mentioned.
    There are other solutions too.
    Try out..All the best !!

    __Khoroo

    Monday, June 30, 2008 9:06 AM
  • I finally got around to using learning .NET C++/CLI and creating a program in VC++2008EE.  A great free tool and one I've been having fun getting around over the last month.

    Once completed I used NSIS to create an install program.

    Obviously worked on my computer with the Visual Studio installed on.  But received the "This application has failed to start because the application configuration is incorrect.  Reinstalling the application may fix this problem"  when trying to run on another computer.

    This thread really helped me with working out what I needed to do to resolve this problem.  I thought that I would just post what I have learnt in case anyone else is in the same situation.

    First stop was Nikola Dudar's WebLog and three important points:

    There are three ways to get an application built with VC++ Express...

    1. Ask user of that computer to install  Visual C++ Redistributable Package...

    2. Build another installer of VC++ libraries using Redistributable Merge Modules installed by VC++ Express into Common Files\Merge Modules...

    3. Statically link your application to VC++ libraries...

    Summarizing:

    PROS: Installs everything that will be needed to deploy a VC++ 2008 project onto any machine
    CONS: Bulky to include when you only really need CFT for VC++2008EE applications

    PROS: Can create an installer that just has the correct modules needed for your program
    CONS: Need to understand WIX to create the installer (not hard but I didn't have the time

    PROS: Can include just the modules you need
    CONS: Included in your program folder, bulking out you install.  Can only use the installed modules and not benefit from updates to the shared modules like the above two methods.

    The third option was excluded for the above reasons.

    I was left to somehow integrate the modules into my NSIS installer.

    I found a blog that showed how to run the redistributable in a silent install mode.

    This would allow me to incorporate the redistributable into my NSIS installer.

    This then posed another problem - what if the user already has it installed?

    I found a .nsi script that had an example of a conditional silent install.

    I then went through the registry to find the correct key for the above redistribution:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}

    And used that to condionally install the package within my NSIS installer.

    I now have a installer that will create an environment for my VC++2008EE compiled .exe to run on any machine with .NET installed.

    -----------------

    Notes:

    • If I do this again I will look into creating a WIX package with just what I need but to be honest I will probably get VS2008 Pro before the next project!
    • As an additional note there is this webpage that explains how to redistribute the modules within the NSIS installer.  Only tested with 2005 (v8.0) dlls tho.
    • If you're a student reading this (most likely if you're using the Express Editions) you can sign up for the Microsoft Dreamspark to get Microsoft software for free, including VS2008 Pro.  As a student that has just graduated and finding out about this initiative I thought I'd try to spread the word...

    Thursday, October 09, 2008 3:13 PM
  • I have built my executable with Visual Studio 8 and the application works fine on Vista or Win7 but does not work on XP. I am using the recipe described except that the file names are msvcr90.dll, msvcp90.dll and msvcm90.dll. Any ideas how I can get this to run on XP?
    Regards,
    Barry

    Thursday, July 02, 2009 3:09 PM
  • @FisherB (Thread resurrector)

    You are using VisualStudio 2008 (That is 9...8 is VS2005, which is what this thread is mostly about.) Ted's answer is still valid (I think!), but this is being handled with merge modules now...they are in Program Files\Common Files\Merge Modules. This is an attempt to provide a tools for creating MSI installation to alleviate this condition you are seeing.

    What is going on is that you've got a C runtime targeted that is newer than the ones in XP. (Mine uses version 7.0.2600.5512, and it is XP Professional, Version 2002, SP 3.

    I assume that you are using .NET framework, which means that you must use dynamic linking on this particular DLL. (It is a requirement of the CLR, so you would have to dump use of CLR to link statically to the c runtime [sigh!].

    I don't know if it is a better fix to install the newer C runtime in XP, nor what the point would be. I think we might be at a hard line between using .NET and targeting older OSes, like XP. (Say it ain't so, MS! That foot has a lot of holes in it already.)
    Thursday, July 02, 2009 7:28 PM
  • Hi Ted,
    How does installing SP1 fix this issue?  I am having issue with a release version of an app that is linking to the dynamic CRT and I would like to understand the solution.
    Previously we were linking to the static CRT, but would like to go the dynamic route...

    Thanks,

    EB

    Thursday, January 07, 2010 12:29 AM
  • Hi All,

    I am facing this above issue which is discussed right from top, i m a newbie and my issue is i try to start any application it gives me same error as "The application failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem" As discussed above some solution but in mycase none works only option for me is to format and reinstall...working on installed VS2005, ms sql2k sp4, ms office, telerik controls, system runs fine, but suddenly after couple of hours, precisely after 3-4 hrs, system stops responding, onreboot none of the application works all given same error    once it gave me issue of CSC.exe files in .net framework where it was not able to find the same...

    Thanks in advance....i just wanna resolve this issue to start working and get sound sleep..

    Tuesday, March 30, 2010 3:14 PM
  • Did you uninstall the VC Redistributable from your system by any chance?
    Well, either way, the VC Redistributable can be downloaded from here. But also, have you been affected by some malware or maybe something which requires the VC Redist and is trying to load in to each process?
    Visit my (not very good) blog at http://c2kblog.blogspot.com/
    Wednesday, March 31, 2010 2:25 AM
  • sounds like you have a registry setting error.  try msvcr80.dll this site has lots of fixes.
    Sunday, March 27, 2011 2:55 PM
  • To locate the msvcr80 file try looking in your Windows\systme32 folder.  If its missing try downloading a fix here http://msvcr80dll.net
    Sunday, March 27, 2011 2:57 PM
  • try looking in system32 folder or get a fix here msvcr90
    Sunday, March 27, 2011 2:58 PM
  • try getting the file from system32 folder or http://msvcr80dll.net
    Sunday, March 27, 2011 4:15 PM