Distributing a Visual Studio C++ Exe That Does not Need the Windows .NET Framework
If like me you export your Visual Studio (2008) .NET C++ project as an EXE, copy it on another machine and get: “This application has failed to start because the application configuration is incorrect”. Then it might be because the target machine is actually missing the Microsoft .NET Framework.
Since I did not really felt like asking all the future users of my app to install the .NET framework, I started looking for a way of embedding these libs in my final app.
While it is apparently not possible to do so without requiring a special (commercial) tool, there is a workaround that worked for me. By forcing the C/C++ to by statically linked the framework functions actually are embedded into the EXE (which, btw, gets much bigger then).
To do so (in Visual Studio .NET 2008 C/C++, Express) do:
Property Page -> Configuration Properties -> C/C++ -> Code Generation then “Runtime Library” should be set to an “non-dll” option such as Multi-threaded (for the release target) or Multi-threaded Debug (to debug your app).
Here we go!
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/36971526-95f3-4a9f-a601-1843c86332c1