Force Attribute Declaration in Derived Classes
Define your attribute class to itself have an AttributeUsageAttribute
attribute where the Inherited
property is true
.
Or don't, since that's the default...
Derived targets (that is, classes if the attribute is on a class, methods if it is on a method, etc.) will then inherit the attribute without explicit declaration.
If by "force", you mean "compile time enforcement": You can't.