InternalsVisibleTo

suggest change

If you want to make internal types or members of an assembly accessible from another assembly, declare that with InternalsVisibleTo and the name of the assembly that is allowed to access them. The attribute is in System.Runtime.CompilerServices and belongs at assembly scope.

In this example code in the assembly MyAssembly.UnitTests is allowed to call internal elements from MyAssembly.

[assembly: InternalsVisibleTo("MyAssembly.UnitTests")]

This is especially useful for unit testing to prevent unnecessary public declarations.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents