• Advertisement
Sign in to follow this  

C# Class visibility question

This topic is 3697 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If you declare a class as internal in C#, it is only visible within that namespace... but does that mean child namespaces can't see it? Say I have namespace my.name.space containing interface IFoo, and I want to put implementations of IFoo in my.name.space.foo, and IFoo and it's implementations are only used by classes within my.name.space. Is there a way to do this? Or do the two namespaces count as unrelated to C#?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by d000hg
If you declare a class as internal in C#, it is only visible within that namespace... but does that mean child namespaces can't see it?



This is incorrect. internal restricts visibility to the assembly not the namespace. As long as your interface/classes are within the same assembly (MSVC project), you're good to go.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement