I have two strong named assemblies A.dll and B.dll. A.dll has internal classes. B.dll uses internal classes from A.dll. I use
[assembly: InternalsVisibleTo("B,PublicKey=[public key of B.dll]")]
in A.dll. It works fine, I can use internal classes from A.dll in B.dll. When I change assembly name in InternalsVisibleTo it stops working, as expected, but if I change only a public key (set wrong public key) it continue working, so it ignored PublicKey parameter.
I use Assembly.Load, for loading assembly.
What is the problem or InternalsVisibleTo not sensitive to PublicKey?