In "C # in Depth 2nd Edition", John Skeet's book, which I just read before the end of Part 2, is mentioned in 7.7.3 that InternalsVisibleTo can also be used with signed assemblies. At the moment, I have not used signatures at all. The security issue for released binaries is actually quite critical, so I plan to completely remove the attribute for release assemblies using the preprocessor variable test.
Just for fun, how would it make sense to use signed assemblies and InternalsVisibleTo ? To use InternalsVisibleTo to specify a friend's signed assembly, I need to specify its public key. I only have this after compiling a friendβs assembly, which has a dependency on the assembly under test (dynamic assembly and unloading were left out, which would inflate coding and readability). This sounds like a chicken egg problem requiring a bootstrap assembly check. I can imagine some tricks with MSBuild and scripts to automate this. Is there a more practical way to do this?
In case it is so tiring, I will stick to my first idea to abandon Unit Testing to build the release (which is somewhat unsatisfactory, since subtle problems of time can remain unchecked ...)
source share