Running App developed on VS11 Beta on a computer without VS11 Beta

155 views Asked by At

I have developed an app using Visual Studio 11 Beta. The app would not run on a computer which does not have VS 11 Beta installed...

I have installed .NET Framework 4.5, but it didn't help...

Does anyone have any suggestion on what should i install or add with the file in order to get it working on any computer without VS11?

1

There are 1 answers

2
LihO On

When you create new project while creating new C++ application with Visual Studio, this project has set Runtime Library option to /MD for Release configuration or /MDd for Debug by default. "Applications compiled with this option are statically linked to MSVCRT.lib. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCR*.DLL, which must be available at run time to applications linked with MSVCRT.lib."

What you need to do, is to go to project settings, Configuration Properties -> C/C++ -> Code Generation and change Runtime Library to Multi-threaded (/MT) for Release / Multi-threaded Debug (/MTd) for Debug. This will cause runtime libraries to be statically linked and your application will not try to load that DLL at runtime.

Good way of checking runtime dependencies is by using Dependency Walker:
You build your application and just drag-and-drop your app (.exe) into it and it will show you its dependencies, where you will probably see MSVCR110.DLL right now. When you change the use of runtime library to /MT, rebuild your app and check whether this dependency has truly disappeared :)