Create a C # class that is publicly accessible inside the DLL but not accessible outside

Sorry if this question is confusing. I have an open static class inside my project that I want to get anywhere inside my application. However, I do not want this class to be open when someone else references my DLL in another project.

Can this be done?

Many thanks!

+4
source share
3 answers

Use an internal class modifier, not a public one. You can also make assembly:[InternalsVisibleTo("SomeOtherAssembly")] if you want to make the class available to another specific DLL.

+9
source

use Inner classes as described in the link.

+5
source

Please read the C # documentation on MSDN or if you can read a good book on .net basics. You can specify the internal qualifier to make the class visible inside the namespace.

+2
source

All Articles