Every time I have used the InternalsVisibleToAttribute
when developing an API, it feels a bit smelly. Like the API is not being designed in a truly encapsulated way. A lot of the times this is out of time constraints - exposing the internal functionality in an elegant, encapsulated way takes time, and a lot of times only one other assembly is going to need it, making InternalsVisibleToAttribute
seem like the correct solution.
Does InternalsVisibleToAttribute
indicate a design smell, such as a case of refactoring gone wrong, or an indication that the two assemblies should not be separate?
Note: I understand the need to use InternalsVisibleToAttribute
for unit testing. This question does not refer to unit testing.
System.Web
assembly: referencesource.microsoft.com/#System.Web/Properties/… – Mr Anderson Aug 30 '16 at 17:10