title: How to use "InternalsVisibleTo" attribute with Strongly named assembly?
body: <p>I am using the "InternalsVisibleTo" attribute with an assembly to expose the internal methods/classes to my unit test project. </p>
  
  <p>I now need to install that assembly into the GAC, so I need to give it a strong name. When I try doing that, I get the following error in Visual Studio. </p>
  
  <blockquote>
    <p>Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations</p>
  </blockquote>
  
  <p>A bit of Googling brought me to the article below: </p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/bb763089.aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/bb763089.aspx</a></p>
  
  <p>This article states:</p>
  
  <blockquote>
    <p>"Determine the public key for the strong-named friend assembly."</p>
  </blockquote>
  
  <p>This article does not say how to determine the public key. Where do I find the public key for the assembly? Also, once I have the public key, would this be the correct way to declare the attribute? </p>
  
  <pre><code>[assembly: InternalsVisibleTo("Namespace.Assembly.Example.Name, PublicKey=ThePublicKey")]
  </code></pre>