Compiler Error CS0713
Static class 'static type' cannot derive from type 'type'. Static classes must derive from object.
If this were allowed, the static class would inherit methods and non-static members from the base class, so it would not be static. Therefore, it is not allowed.
The following sample generates CS0713:
C#
// CS0713.cs
public class Base
{
}
public static class Derived : Base // CS0713
{
}
public class CMain
{
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: