Skip to content

Attribute Metadata Storage

Question

Where is information set in attributes stored?

Short interview answer

Attribute information is stored as metadata in the compiled assembly and can be retrieved through reflection.

Detailed answer

Attributes decorate assemblies, types, members, parameters, and return values. The compiler writes their constructor and named argument data into assembly metadata. Reflection APIs can read that metadata at runtime; some tools also inspect it without running the application.

Sources