Specifies which common language runtime version and, optionally, .NET Framework version the application supports.
<supportedRuntime version="runtime version" sku="SKU ID"/>
A string value that specifies the version of the common language runtime (CLR) that this application supports. For valid values of the
A string value that specifies the stock-keeping unit (SKU), which in turn specifies which .NET Framework release this application supports.
Starting with .NET Framework 4.0, the use of the
For valid values of the
If the <supportedRuntime> element is not present in the application configuration file, the version of the runtime used to build the application is used.
The <supportedRuntime> element should be used by all applications built using version 1.1 or later of the runtime. Applications built to support only version 1.0 of the runtime must use the <requiredRuntime> element.
If you use the CorBindToRuntimeByCfg function to specify the configuration file, you must use the
<requiredRuntime> element for all versions of the runtime. The
<supportedRuntime> element is ignored when you use CorBindToRuntimeByCfg.
For apps that support versions of the runtime from the .NET Framework 1.1 through 3.5, when multiple versions of the runtime are supported, the first element should specify the most preferred version of the runtime, and the last element should specify the least preferred version. For apps that support the .NET Framework 4.0 or later versions, the
version attribute indicates the CLR version, which is common to the .NET Framework 4 and later versions, and the
sku attribute indicates the single .NET Framework version that the app targets.
If the <supportedRuntime> element with the
sku attribute is present in the configuration file and the installed .NET Framework version is lower than the specified supported version, the application fails to run and instead displays a message asking to install the supported version. Otherwise, the application attempts to run on any installed version, but it may behave unexpectedly if it is not fully compatible with that version. (For compatibility differences between versions of .NET Framework, see Application compatibility in the .NET Framework.) Therefore, we recommend that you include this element in the application configuration file for easier error diagnostics. (The configuration file automatically generated by Visual Studio when creating a new project already contains it.)
If your application uses legacy activation paths, such as the CorBindToRuntimeEx function, and you want those paths to activate version 4 of the CLR instead of an earlier version, or if your application is built with the .NET Framework 4 but has a dependency on a mixed-mode assembly built with an earlier version of the .NET Framework, it is not sufficient to specify the .NET Framework 4 in the list of supported runtimes. In addition, in the <startup> element in your configuration file, you must set the
useLegacyV2RuntimeActivationPolicy attribute to
true. However, setting this attribute to
true means that all components built with earlier versions of the .NET Framework are run using the .NET Framework 4 instead of the runtimes they were built with.
We recommend that you test applications with all the .NET Framework versions that they can run on.
"runtime version" values
runtime attribute specifies the Common Language Runtime (CLR) version that is required for a given application. All .NET Framework v4.x versions specify the
v4.0 CLR. The following table lists valid values for the runtime version value of the
|.NET Framework version||
"SKU ID" values
sku attribute uses a target framework moniker (TFM) to indicate the version of .NET Framework that the app targets and requires to run. The following table lists valid values that are supported by the
sku attribute, starting with .NET Framework 4.
|.NET Framework version||
|4.0, Client Profile||".NETFramework,Version=v4.0,Profile=Client"|
|4.0, platform update 1||".NETFramework,Version=v4.0.1"|
|4.0, Client Profile, update 1||".NETFramework,Version=v4.0.1,Profile=Client"|
|4.0, platform update 2||".NETFramework,Version=v4.0.2"|
|4.0, Client Profile, update 2||".NETFramework,Version=v4.0.2,Profile=Client"|
|4.0, platform update 3||".NETFramework,Version=v4.0.3"|
|4.0, Client Profile, update 3||".NETFramework,Version=v4.0.3,Profile=Client"|
The following example shows how to specify the supported runtime version in a configuration file. The configuration file indicates that the app targets .NET Framework 4.7.
<configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" /> </startup> </configuration>
This element can be used in the application configuration file.
Submit and view feedback for