I have an assembly with functionality that I don't want exposed as public but still accessible to my other assemblies. This can be done using InternalsVisibleToAttribute by specifying each assembly that it will make its internals visible to.
I was wondering if there is a way that I didn't have to specify all the referencing assemblies but instead just enforce the rule that an assembly must be signed by the same snk to have the internals made visible.
Does this functionality exist and if so, could someone point me in the right direction?
No, I don't believe anything like that is available automatically.
You could write your own tool to generate the [InternalsVisibleTo(...)]
lines, and add unit tests to ensure that all such references have the same key though.
I'm not aware of anything that enforces this for you and automatically generates the InternalsVisibleTo but you could write a Visual Studio Extension that does that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With