Attributes are a way of attaching meta data to different runtime elements such as assemblies, types, methods, properties, fields and even arguments! All attributes ultimately derive from the System.Attribute base class and also have some attributes applied to them (AttributeUsage) to control how that attribute can be applied to code.

There are also different types of attributes, for example, there are attributes that result in changes to the compiled output at compile time (like the PrincipalPermission attribute), attributes which the runtime refers to when it is inflight – such as the ContextAttribute, and then there are the attributes that are pure meta data – such as the WebMethodAttribute.

While attributes are cool – they do incur some runtime overhead and it can sometimes be more performant to tag with interfaces rather than tagging with attributes.