1 // ==++== 2 // 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // 5 // ==--== 6 // 7 /*============================================================ 8 ** 9 ** Class: TargetFrameworkAttribute 10 ** 11 ** 12 ** Purpose: Identifies which SKU and version of the .NET 13 ** Framework that a particular library was compiled against. 14 ** Emitted by VS, and can help catch deployment problems. 15 ** 16 ===========================================================*/ 17 using System; 18 using System.Diagnostics.Contracts; 19 20 namespace System.Runtime.Versioning { 21 22 [AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] 23 public sealed class TargetFrameworkAttribute : Attribute { 24 private String _frameworkName; // A target framework moniker 25 private String _frameworkDisplayName; 26 27 // The frameworkName parameter is intended to be the string form of a FrameworkName instance. TargetFrameworkAttribute(String frameworkName)28 public TargetFrameworkAttribute(String frameworkName) 29 { 30 if (frameworkName == null) 31 throw new ArgumentNullException("frameworkName"); 32 Contract.EndContractBlock(); 33 _frameworkName = frameworkName; 34 } 35 36 // The target framework moniker that this assembly was compiled against. 37 // Use the FrameworkName class to interpret target framework monikers. 38 public String FrameworkName { 39 get { return _frameworkName; } 40 } 41 42 public String FrameworkDisplayName { 43 get { return _frameworkDisplayName; } 44 set { _frameworkDisplayName = value; } 45 } 46 } 47 } 48