CLSCompliantAttribute
suggest changeSyntax
- [assembly:CLSCompliant(true)]
- [CLSCompliant(true)]
Parameters
- CLSCompliantAttribute(Boolean) : Initializes an instance of the CLSCompliantAttribute class with a Boolean value indicating whether the indicated program element is CLS-compliant
Remarks
The Common Language Specification (CLS) is a set of base rules to which any language targeting the CLI(language which confirms the Common Language Infrastructure specifications) should confirm in order to interoperate with other CLS-compliant languages.
You should mark your assembly as CLSCompliant in most cases when you are distributing libraries. This attribute will guarantee you that your code will be usable by all CLS-compliant languages. This means that your code can be consumed by any language that can be compiled and run on CLR(Common Language Runtime)
When your assembly is marked with CLSCompliantAttribute
, the compiler will check if your code violates any of CLS rules and return warning if it is needed.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents