NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Marking Items as CLS-Compliant

The CLS specifies how to mark externally visible parts of an assembly to indicate whether or not they comply with the CLS requirements. This is done using the custom attribute mechanism to extend metadata. The class System.CLSCompliantAttribute indicates what assemblies are CLS-compliant and what types and type members are not CLS-compliant in a compliant assembly.

The constructor for System.CLSCompliantAttribute takes a Boolean argument indicating whether the item with which it is associated is or is not CLS-compliant. This allows any item (assembly, type, or type member) to be explicitly marked as CLS-compliant or not.

If no attribute is associated with an item, then:

CLS Rule 35: Types whose CLS-compliance differs from that of the assembly in which they are defined must be marked with the System.CLSCompliantAttribute. Similarly, members whose CLS-compliance differs from that of their class must also be so marked.