A class that is used as a custom attribute is not derived from System.Attribute. Only classes that have System.Attribute as a base class can be used as custom attributes.
To correct this error
-
Make sure that the custom attribute class has System.Attribute as a base class.