Compiler Error CS1527 

Error Message

Namespace elements cannot be explicitly declared as private, protected, or protected internal

Type declarations in a namespace can have either public or internal access. If no accessibility is specified, internal is the default.

The following sample generates CS1527:

// CS1527.cs
namespace Sample
{
   private class C1 {};             // CS1527
   protected class C2 {};           // CS1527
   protected internal class C3 {};  // CS1527
}

Community Additions

ADD
Show: