Metadata and Extensibility

This chapter has alluded to metadata attributes rather liberally up to this point without providing a formal definition. Most constructs in CLR metadata have a 32-bit attribute field that is used to fine-tune the definition of the type, field, or method the attribute is associated with. The interpretation and format of these attributes is fixed and is defined in the CLI specification submitted to ECMA. Some of the metadata attributes discussed so far include initonly (field), beforefieldinit (type), and hidebysig (method). One can make these fixed attributes visible via reflection as well as using the unmanaged metadata interface IMetaDataImport.

Compilers are responsible for setting these attributes based on programming ...

Get Essential .NET, Volume 1: The Common Language Runtime now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.