C# Error
CS7003 – Unexpected use of an unbound generic name
Reason for the Error & Solution
Unexpected use of an unbound generic name
This error occurs if you use a generic type needing one parameter type without passing any generic parameter type name between the angle brackets. This use may be a variable declaration, or an object instantiation.
To correct this error
Provide one parameter type name in angle brackets when using a generic type.
Example
The following example generates CS7003:
// CS7003.cs
class Program
{
static void Main(string[] args)
{
var myVar1 = new MyGenericClass<>(); //CS7003
MyGenericClass<> var2; //CS7003
}
}
public class MyGenericClass<T> { }