This documentation is archived and is not being maintained.

Compiler Error CS0305

Visual Studio 2008

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
   }
}
Show: