O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

CLSCompliantAttribute

Synopsis

This attribute indicates that a program element is compliant with the CLS. If you use non-CLS compliant classes (such as UInt32) in a class marked as compliant, the compiler generates a compliance warning.

By default, types without this attribute are not CLS-compliant unless they are contained in a CLS-compliant type or assembly. You can specifically mark non-CLS compliant members inside a CLS-compliant type using [CLSCompliantAttribute(false)].

public sealed class CLSCompliantAttribute : Attribute {
// Public Constructors
   public method CLSCompliantAttribute(bool isCompliant);  
// Public Instance Properties
   public field bool IsCompliant{get; } 
}

Hierarchy

ObjectAttributeCLSCompliantAttribute

Valid On

All

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required