0 out of 3 rated this helpful - Rate this topic

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
   }
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ