System.Runtime.Versioning.TargetFrameworkAttribute Class

Identifies the version of the .NET Framework that a particular assembly was compiled against.

See Also: TargetFrameworkAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class TargetFrameworkAttribute : Attribute

Remarks

The System.Runtime.Versioning.TargetFrameworkAttribute class provides an attribute that you can apply to an assembly to indicate the version of the .NET Framework runtime against which the assembly was built. For example, the following example applies the TargetFrameworkAttribute to an assembly to indicate that it was built using net_v40_long.

code reference: System.Runtime.Versioning.TargetFrameworkAttribute#1

The System.Runtime.Versioning.TargetFrameworkAttribute class constructor has a single parameter, frameworkName, that specifies the .NET Framework version against which the assembly was built. This parameter maps to the TargetFrameworkAttribute.FrameworkName property. In addition, the System.Runtime.Versioning.TargetFrameworkAttribute attribute can specify a TargetFrameworkAttribute.FrameworkDisplayName property to provide a more descriptive .NET Framework version string that is suitable for displaying to clients of the assembly. The following example applies the TargetFrameworkAttribute to an assembly and assigns both property values to indicate that the assembly was built using net_v40_long. 

code reference: System.Runtime.Versioning.TargetFrameworkAttribute#2

Requirements

Namespace: System.Runtime.Versioning
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0