David.Chu.ca
David.Chu.ca

Reputation: 38704

Internal Namespace for .Net?

Here is a simplified example:

namespace MyNS.Proj.InternalNS {
   internal class InternalClass1 {...}
}

I would like to make InternalNS as the part in MyNS.Proj invisible to outside since all the classes with the namespace are internal or private. Not sure if this is possible?

Upvotes: 0

Views: 787

Answers (2)

Jeff Yates
Jeff Yates

Reputation: 62407

Namespaces do not have access modifiers. The namespace will always be visible to external code even if its contents are not.

Upvotes: 4

Oded
Oded

Reputation: 499392

The namespace declaration had no accessibility modifiers. It will always be seen by external classes, even if all members are hidden.

Upvotes: 2

Related Questions