Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0405

Duplicate constraint 'constraint' for type parameter 'type parameter'

Two of the constraints on the generic declaration are identical. To get rid of the error, remove the duplicate.

The following sample generates CS0405:

// CS0405.cs
interface I
{
}

class C<T> where T : I, I  // CS0405.cs
{
}

Community Additions

ADD
Show:
© 2015 Microsoft