Compiler Error CS1057
'member': static classes cannot contain protected members
This error is generated by declaring a protected member inside a static class.
The following example generates CS1057.
C#
// CS1057.cs
using System;
static class Class1
{
protected static int x; // CS1057
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: