public sealed class CLSCompliantAttribute : Attribute
Object
Attribute
CLSCompliantAttribute
mscorlib
BCL
Indicates whether the target of the current attribute complies with the Common Language Specification (CLS).
If no CLSCompliantAttribute is associated with a given assembly, that assembly is assumed not to be CLS-compliant.A type is assumed to be CLS-compliant if and only if its enclosing type (for nested types) or assembly (for top-level types) is CLS-compliant. Other members (methods, fields, properties and events) are CLS-compliant if and only if the type in which they are defined is CLS-compliant.
[Note: The CLS is a subset of CLI features that is supported by a broad set of compliant languages and tools. CLS-compliant languages and tools are guaranteed to interoperate with other CLS-compliant languages and tools.
Because the CLS defines the rules for language interoperability, its rules apply only to "externally visible" items. The CLS assumes that language interoperability is important only across the assembly boundary - that is, within a single assembly there are no restrictions as to the programming techniques that are used. Thus, the CLS rules apply only to items that are visible outside of their defining assembly and have public, family, or family-or-assembly accessibility.
For more information on CLS compliance, see Partition I of the CLI Specification.
This attribute can be applied to any valid attribute target. For a complete list of valid targets, see AttributeTargets.
]
AttributeUsageAttribute(AttributeTargets.All, AllowMultiple=false, Inherited=true)
System Namespace
CLSCompliantAttribute Constructors
CLSCompliantAttribute Constructor
CLSCompliantAttribute Properties
public CLSCompliantAttribute(bool isCompliant);
Constructs and initializes a new instance of the CLSCompliantAttribute class.
- isCompliant
true
if the target of the new instance complies with the CLS; otherwise,false
.
System.CLSCompliantAttribute Class, System Namespace
public bool IsCompliant { get; }
Gets a Boolean indicating whether the target of the current instance is CLS-compliant.
true
if the target of the current instance complies with the CLS; otherwise,false
.
This property is read-only.
System.CLSCompliantAttribute Class, System Namespace