InternalsVisibleTo
suggest changeIf 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents