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:
C#
// CS1530.cs
namespace a
{
new class i // CS1530
{
}
// try the following instead
class ii
{
public static void Main()
{
}
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: