.net - When should [assembly: InternalsVisibleTo()] be used? -


I understand that using the InternalVisibleTo attribute to expose the types and methods of the internal access modifier I am using it to highlight the internal methods for a separate Assembly with a single suite of unit tests alone.

I am struggling to think of another scenario to use it. Was this special feature specifically offered for unit testing or was there any other reason?

There may be a scenario that you argue between the assemblies (such as internal data objects and logic levels) Is to be separated. You do not want to expose sections to your users, but still you want to use the objects in your own assemblies.

I think that this is not a very common scenario, I rarely in the non-unit test context InternalsVisibleTo .


Comments