Compiler Error CS0305
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0305 

Error Message

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
© 2015 Microsoft