C# Error CS0689 – Cannot derive from ‘{0}’ because it is a type parameter

C# Error

CS0689 – Cannot derive from ‘{0}’ because it is a type parameter

Reason for the Error & Solution

Cannot derive from ‘identifier’ because it is a type parameter

Base classes or interfaces for generic classes cannot be specified by a type parameter. Derive from a specific class or interface, or a specific generic class instead, or include the unknown type as a member.

The following sample generates CS0689:

// CS0689.cs  
class A<T> : T   // CS0689  
{  
}  

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...