Edit

Share via


Compiler Error CS0698

A generic type cannot derive from 'class' because it is an attribute class

Any class that derives from an attribute class is an attribute. Attributes are not allowed to be generic types.

The following sample generates CS0698:

C#
// CS0698.cs  
class C<T> : System.Attribute  // CS0698  
{  
}