Export (0) Print
Expand All
Expand Minimize

Compiler Warning (level 4) CS0402

'identifier' : an entry point cannot be generic or in a generic type

The entry point was found in a generic type. To remove this warning, implement Main in a non-generic class or struct.

// CS0402.cs
// compile with: /W:4
class C<T>
{
   public static void Main()  // CS0402
   {
      
   }
}

class CMain
{
   public static void Main() {}
}

Community Additions

ADD
Show:
© 2014 Microsoft