9

I could not find any clear statement on MSDN regarding this, there are some examples with strong names other are without, for me it seems like it should work even without but its not working.

Thank you

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130

1 Answers1

15

The documentation is quite explicit:

Both the current assembly and the friend assembly must be unsigned, or both must be signed with a strong name. If they are signed with a strong name, the argument to the InternalsVisibleToAttribute constructor must include the full public key as well as the name of the assembly.

See this answer for an example of what full public key means.

Community
  • 1
  • 1
Frédéric Hamidi
  • 258,201
  • 41
  • 486
  • 479
  • Thank you for the answer, thats what i understood from the documentation too, but still for some reason it isnt working. i know what full public key means but i would prefer to expose the internal methode than integrating public keys in all DLL's i found the option without public keys very helpful concerning unittests – CloudyMarble May 08 '12 at 06:37
  • 4
    Well, if you don't want to specify the full public key, then *both* assemblies have to be unsigned. Is that the case? Also be wary that the presence of `[AssemblyKeyFile]` and `[AssemblyKeyName]` attributes, even empty, can mess with `[InternalsVisibleTo]`, as [this answer](http://stackoverflow.com/a/3594856/464709) reveals. – Frédéric Hamidi May 08 '12 at 06:41