CLSCompliantAttribute

suggest change

Syntax

  1. [assembly:CLSCompliant(true)]
  2. [CLSCompliant(true)]

Parameters

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.

List of CLI 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents