Export (0) Print
Expand All
Expand Minimize

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.

// CS1057.cs
using System;

static class Class1
{
    protected static int x;   // CS1057
    public static void Main()
    {
    }
}

Community Additions

ADD
Show:
© 2014 Microsoft