Type argument '<typeargumentname>' does not inherit from or implement the constraint type '<typeparametername>'

A type argument supplied to a generic type does not satisfy the inheritance or implementation constraint on its corresponding type parameter.

A constraint list imposes requirements on the type argument passed to the type parameter. The possible requirements include the following:

  • The type argument must implement one or more interfaces

  • The type argument must inherit from at most one class

You can combine the preceding requirements for a single type parameter. Visual Basic cannot construct the type unless the code supplies type arguments that satisfy every constraint on every type parameter defined on the generic type.

Error ID: BC32044

To correct this error

  • Select a type argument of a type that implements every interface specified for the type parameter, and that inherits from the specified class if there is one.

See also