Can I make the insides visible to all assemblies signed with the same key?

I have an assembly with functionality that I do not want to show as public, but still available for my other assemblies. This can be done using InternalsVisibleToAttribute, indicating to each assembly that it will make its internal elements visible.

I was wondering if there was a way that I did not need to specify all referenced assemblies, but instead just apply the rule that the assembly must be signed with the same snk in order to make the insides visible.

Does this functionality exist, and if so, can someone point me in the right direction?

+6
source share
3 answers

No, I do not think that something like this is available automatically.

You can write your own string creation tool [InternalsVisibleTo(...)] and add unit tests to ensure that all such links have the same key.

+3
source

I donโ€™t know anything that will provide this for you, and will automatically generate InternalsVisibleTo, but you can write a Visual Studio extension that does this.

+1
source

I hope the utility that I created several years ago can make your life a little easier to add InternalsVisibleTo to your AssemblyInfo.cs file.

Here's the link: http://vkreynin.wordpress.com/2007/12/09/testing-internals-members-with-internalsvisibleto-attribute/

0
source

Source: https://habr.com/ru/post/899434/


All Articles