Share via


Compiler Error CS1530

Keyword 'new' is not allowed on elements defined in a namespace

It is not necessary to specify the new keyword on any construct that is in a namespace.

The following sample generates CS1530:

// CS1530.cs
namespace a
{
   new class i   // CS1530
   {
   }

   // try the following instead
   class ii
   {
      public static void Main()
      {
      }
   }
}