Error "Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal"

Because private means that the member is only visible in the containing class. Since a top-level class has no class containing it it cannot be private (or protected). (Internal or public are valid modifiers though).

What would you want private to mean on a top-level class?

Of course all modifiers apply to nested classes, i.e. a class defined within another class.


You can use only public or internal in the Namespace level