<supportedRuntime> Element


Specifies which versions of the common language runtime the application supports. This element should be used by all applications built with version 1.1 or later of the .NET Framework.




<supportedRuntime version="runtime version" sku="sku id"/>  

versionOptional attribute.

A string value that specifies the version of the common language runtime (CLR) that this application supports. For valid values of the version attribute, see the "runtime version" values section. Note: Through the .NET Framework 3.5, the "runtime version" value takes the form major.minor.build. Beginning with the .NET Framework 4, only the major and minor version numbers are required (that is, "v4.0" instead of "v4.0.30319"). The shorter string is recommended.
skuOptional attribute.

A string value that specifies the stock-keeping unit (SKU), which in turn specifies which .NET Framework release this application supports.

Starting with the .NET Framework 4.0, the use of the sku attribute is recommended. When present, it indicates the version of the .NET Framework that the app targets.

For valid values of the sku attribute, see the "sku id" values section.

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.

System_CAPS_ICON_note.jpg Note

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 single .NET Framework version that the app targets.

System_CAPS_ICON_note.jpg Note

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.

The following table lists valid values for the runtime version value of the version attribute.

.NET Framework versionversion attribute

The following table lists the versions of the .NET Framework starting with the .NET Framework 4 that are supported by the sku attribute. Note that the sku attribute starting with the .NET Framework 4 indicates the version of the .NET Framework that the app targets.

.NET Framework versionsku attribute
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 table shows which installed versions of the .NET Framework 4 an application will run on, for different values of the sku attribute, when the version attribute is v4.0 and the sku attribute identifies the .NET Framework 4 or one of its platform updates (PU).

Value of sku attribute4.0 Client4.0 Full4.0 Client + PU 14.0 Full + PU 14.0 Client + PU 24.0 Full + PU 24.0 Client + PU 34.0 Full + PU 34.5 and later

The following example shows how to specify the supported runtime version in a configuration file. The configuration file indicates that the app targets the .NET Framework 4.6.

      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />  

This element can be used in the application configuration file.

Startup Settings Schema
Configuration File Schema
In-Process Side-by-Side Execution