Expand Minimize
0 out of 1 rated this helpful - Rate this topic

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:

// CS0698.cs
class C<T> : System.Attribute  // CS0698
{
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.