'<typename>' cannot be used as an attribute because it does not have a 'System.AttributeUsageAttribute' attribute

An attempt was made to use an attribute that was declared without the System.AttributeUsageAttribute to define its usage.

Error ID: BC31505

To correct this error

  • Custom attributes must be classes derived fromSystem.Attribute that have the AttributeUsageAttribute attribute applied.

See Also

Reference

AttributeUsageAttribute

Other Resources

Custom Attributes in Visual Basic