locked
Problem: This application has failed to start because its side-by-side configuration is incorrect RRS feed

  • Question

  • Hello all,

    I want to run a simple x64 .exe program on an 64-bit Windows Server 2008 CLEAN install.

    I developed a simple program (CLR Console Application) to write "Hello World" on a text file in C:. I want to run it on a x64 computer without Visual Studio installed, so what I did was:

    1. Went to Project Properties -> Configuration Manager
    2. Changed the Active Solutions Platform to x64 (both for Debug and Release)
    3. Done this using Visual Studio 2008 on a 32-bit computer.

    When I run it on the 32-bit computer, it seems to have successfully created it for an x64 computer since it says it is not a valid "win32 application".

    However, I tried copying the .exe to the Win Server 2008 computer but I get an error saying:

    "This application has failed to start because its side-by-side configuration is incorrect"

    I think that this is because I need the .NET framework or the libraries of Visual C++.

    I have searched through the net and most of the solutions involve copying the dll files / library files, or installing the Visual Runtime C++ Redistributable Package.

    I want to ask if: Is there a possible way of running my applications to a without copying the dll / library files or installing the VC++ Runtime Redistributable Package?
    Friday, February 5, 2010 2:30 AM

Answers

  • Hi all, thanks for the replies!

    I finally made an application that worked on a 64-bit Windows PE. Instead of using CLR Console application, I used Win 32 Project -> Console Application.
    I ran the .exe file on the WinPE and it worked.

    However, my problem in using Win 32 is that the syntax it uses seems to be different than what CLR uses. Although both are under Visual C++. When I copy pasted the code from my CLR program to the Win 32 program, it produced compile errors.

    One thing I noticed is that Win 32 uses printf. ex. printf("Hello World");. Isn't printf normally used in C applications?

    Thank you very much!

    Edit: I just removed the "stdfax.h" and included iostream and fstream (without the .h), and it finally works. Thanks all for helping me.
    • Marked as answer by WATER004 Tuesday, February 9, 2010 3:33 PM
    Monday, February 8, 2010 6:38 AM

All replies

  • If your application is dependent on other frameworks and libraries, you will definitely need these dependent files on the machine you're running the application.
    You can create a setup project or installshield project to package all the dependencies for deployment on a fresh machine.


    «_Superman_»
    Microsoft MVP (Visual C++)
    Friday, February 5, 2010 5:02 AM
  • Hi thomas, thansk for replying!

    I just want to confirm that, if I develop applications using Visual C++ in Visual Studio 2008, there is no way I can possible remove its dependencies to the Visual Studio Library?

    Thanks!
    Saturday, February 6, 2010 4:34 PM
  • Only unmanaged (those applications that do not depend on the .NET Framework) can be built using the /MT switch. Using the /MT switch allows you to create an executable that has no dependencies whatsoever. For managed applications (using the .NET Framework), it's a good idea to build an MSI using the Setup and Deployment project template so that it is easy to install on other target machines.
    Saturday, February 6, 2010 4:50 PM
  • With your layout though, your only dependency remaining unsatisfied is the VC2008 libraries. Windows 2008 and Vista come with .Net 3.5 installed (or is it 3, either way you have your dependency satisfied.)
    If you want an application to be managed without the dependency on the VC library and you don't want to use C++ interop or any native C++ code then just set the compiler to /clr:safe. The resulting executable will not have any native code and will not use the CRT, but if you are doing this then why not just use C#. If you want to use native code only then as Brian said the best solution is /MT. But if you want to use both native and managed in the same executable then you are stuck.
    Visit my (not very good) blog at http://c2kblog.blogspot.com/
    Saturday, February 6, 2010 6:49 PM
  • Hi all, thanks for the replies!

    I finally made an application that worked on a 64-bit Windows PE. Instead of using CLR Console application, I used Win 32 Project -> Console Application.
    I ran the .exe file on the WinPE and it worked.

    However, my problem in using Win 32 is that the syntax it uses seems to be different than what CLR uses. Although both are under Visual C++. When I copy pasted the code from my CLR program to the Win 32 program, it produced compile errors.

    One thing I noticed is that Win 32 uses printf. ex. printf("Hello World");. Isn't printf normally used in C applications?

    Thank you very much!

    Edit: I just removed the "stdfax.h" and included iostream and fstream (without the .h), and it finally works. Thanks all for helping me.
    • Marked as answer by WATER004 Tuesday, February 9, 2010 3:33 PM
    Monday, February 8, 2010 6:38 AM