Classes that are generic or contained in a generic type cannot inherit from an attribute class

A class that is either generic or nested within a generic type specifies that it inherits from an attribute class.

Visual Basic and the .NET Framework do not currently support any combination of attributes and generic types. This means the following limitations apply:

  • An attribute cannot be a generic type or be declared within a generic type.

  • An attribute cannot inherit from a generic class, nor can a generic class inherit from an attribute.

  • When you apply an attribute, you cannot supply an argument that is any of the following:

    • A generic type,

    • A type constructed from a generic type,

    • A type parameter of a containing type, or

    • A type constructed from a type parameter of a containing type.

Error ID: BC32074

To correct this error

  • Change the base class to something other than an attribute class, or remove the Inherits statement entirely.

See Also

Concepts

Attributes Overview in Visual Basic

Generic Types in Visual Basic

Inheritance Basics

Reference

Attribute

Inherits Statement