Information Technology Reference
In-Depth Information
Predefined Attributes
The .NET Framework predefines a number of attributes that are understood and interpreted
by the compiler and the CLR. Table 21-2 lists some of these attributes.
Table 21-2. Important Attributes Defined in .NET
CLSCompliant
Declares that the publicly exposed members should be checked by the com-
piler for compliance with the CLS. Compliant assemblies can be used by any
.NET-compliant language.
Serializable
Declares that the construct can be serialized.
NonSerialized
Declares that the construct cannot be serialized.
Obsolete
Declares that the construct should not be used. The compiler also produces a
compile time warning or error message, if the construct is used.
DLLImport
Declares that the implementation is unmanaged code.
WebMethod
Declares that the method should be exposed as part of an XML web service.
AttributeUsage
Declares what types of program constructs the attribute can be applied to.
This attribute is applied to attribute declarations.
Search WWH ::




Custom Search