Configuration.TargetFramework Property

Definition

Gets or sets the targeted version of .NET when a version earlier than the current one is targeted.

C#
public System.Runtime.Versioning.FrameworkName TargetFramework { get; set; }

Property Value

The name of the targeted version of .NET. The default value is null, which indicates that the current version is targeted.

Remarks

When the configuration system serializes a hierarchy of configuration objects to XML, it checks the value of this property. If the property is not null, the configuration system performs version checks for each configuration section group and configuration section. The configuration system also performs version checks for individual configuration properties that are marked as having changed across versions. (For more information, see ConfigurationPropertyOptions.) The configuration system also performs version checks for configuration elements in configuration sections.

If the value of this property is null, the configuration system does not perform any version checks during serialization.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also