When you see [Serializable]and [NonSerialized] attributes in your code, the compiler decorates the class' metadata with the SerializableAttribute and NonSerializedAttribute classes. How does it know that those classes are attributes? It knows because each of these classes derives from the System.Reflection.Attribute class. Every attribute you use must derive from this class. It is the magic that tells the compiler that it is an attribute.