Compiler Error CS0305
Using the generic type 'generic type' requires 'number' type arguments
This error occurs when the expected number of type arguments was not found. To resolve C0305, use the required number of type arguments.
The following sample generates CS0305.
// CS0305.cs
public class MyList<T> {}
public class MyClass<T> {}
class MyClass
{
public static void Main()
{
MyList<MyClass, MyClass> list1 = new MyList<MyClass>(); // CS0305
MyList<MyClass> list2 = new MyList<MyClass>(); // OK
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: