This documentation is archived and is not being maintained.

Running a Managed Extensions for C++ Application on a Previous Runtime Version

Unless otherwise specified, a Visual C++ .NET application is built to run with the common language runtime version that the compiler uses to build the application. However, it is possible for an EXE application built with one version of the runtime to run on any version of the runtime.

To accomplish this, an .exe application needs an app.config file containing runtime version information (with the supportedRuntime tag). The Visual C++ .NET 2003 development environment does not support modification of the app.config file, but other Visual Studio languages do with their project's Property Pages dialog box. For example, modify the Supported Runtimes property (see General Property Pages Dialog Box) of a Visual C# Windows application and use that updated app.config file in your C++ application.

At runtime, the name of the app.config file must be filename.ext.config (where filename.ext is the name of the executable that started the application) and the file must be in the same directory as the executable. For example, if you application is called TestApp.exe, the app.config file would be named TestApp.exe.config.

If you specify more than one runtime version and the application runs on a computer with more than one installed runtime version, the application uses the first version specified in the config file that matches an installed runtime that is available on the system.

For more information, see Targeting a .NET Framework Version

Windows applications built with the Visual C++ .NET 2003 compiler need to be compiled with /clr:initialAppDomain to run on the previous version of the common language runtime.

Targeting the previous version of the runtime for ASP.NET Web applications is not supported in this release of Visual C++.

See Also

Interoperability in Managed Extensions for C++