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
{
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: