The. NET Framework 4.0 is installed on the computer, and the. NET 2.0 application is running an error:
Find instructions in MSDN:
Reference content
The. NET Framework 4 does not automatically use its own version of the common language runtime to run applications built from earlier versions of the. NET Framework. To run an older application using the. NET Framework 4, you must compile the application using the target. NET Framework version specified by the properties of the project in Visual Studio, or use the <supportedruntim in the application configuration file The e> element can specify the supported runtime.
. NET 2.0 applications cannot run a workaround under. NET Framework 4.0
Open app.config and add the bottom content:
<?xml version= "1.0" encoding= "Utf-8"?>
<configuration>
<startup>
<supportedruntime version= "v2.0.50727"/>
<supportedruntime version= "v4.0"/>
</startup>
</configuration>
Supportedruntime is used to specify the version of the common language runtime supported by the application, which indicates that the application can run under the. NET Framework 2.0 and. NET Framework 4.0.
For the Version property value, the first three versions of the CLR are specified by "v1.0.3705", "v1.1.4322", and "v2.0.50727", starting with the. NET Framework version 4, only the major and minor version numbers are required (that is, "v4.0" instead of " v4.0.30319 ").