Posted: 2015-04-20 19:24:49
There is a very easy way to run .NET 3.5 applications under .NET 4.5 (and 4.0), without having .NET 3.5 installed…
Edit the application’s app.exe.config file:
And within the “
<configuration>” section, add in the support for runtime v4:
<startup> <supportedRuntime version="v2.0.50727"/> <supportedRuntime version="v4.0"/> </startup>
The above configuration will have the system use .NET 3.5 if it finds it [.NET v3.5 uses runtime “v2.0″], otherwise it will use .NET 4.0 or 4.5 (which use runtime “v4.0″).
And if your application is having issues (e.g., nothing shows on-screen except the application border with a background color inside) on a Windows 7 + (or Server 2008 +) system with .NET v4, that also has .NET 3.5 enabled, try placing the
<suppportedRuntime version="v4.0"/> line above the 2.0 line – so it tries to use .NET v4 first… As some systems with both .NET v4 and v3.5 have the latter in a corrupted state.
Whether this works depends on whether the code used in the application is compatible with the changes that were made in the newer releases of .NET version and runtime. Most applications will be 100% compatible with the higher version.
1. Graph of the default .NET version that shipped with the Windows OS version:
2. Microsoft documentation on the above configuration changes: How to Configure an App to Support .NET Framework 4 or 4.5
3. Microsoft documentation on which versions of .NET that can be installed per Windows OS version: .NET Framework Versions and Dependencies