문제

It seems like using this attribute for anything other than unit testing of non-public methods/properties would be a huge code smell. Are there any legitimate uses of the InternalsVisibleTo attribute to achieve something that might be otherwise impossible/too cumbersome using standard design patterns?

도움이 되었습니까?

해결책

We used it in building the Microsoft Surface SDK so that certain platform assemblies could talk to each other without opening up unwanted public APIs. Though this did create a burden of having manually ensure that these libs were only using "approved" internal things from each other.

다른 팁

Could be used to share code between your own assemblies that you do not want to publicly expose to the outside.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top