AssemblyKeyFile

suggest change

An assembly must have a strong name before it can be installed in the GAC. Create a public/private key pair and store it in an .snk file.

To create a strong-name key file:

  1. Open the Developer Command Prompt for Visual Studio (with administrator access).
  2. At the command prompt, type cd C:\Directory_Name and press Enter.
  3. At the command prompt, type sn -k KeyFileName.snk and press Enter.

Once KeyFileName.snk has been created, reference it from the project. AssemblyKeyFileAttribute gives the path to the .snk file used when the class library is built.

Properties -> AssemblyInfo.cs

[assembly: AssemblyKeyFile(@"c:\Directory_Name\KeyFileName.snk")]

This produces a strong-named assembly. After the assembly is strong-named, it can be installed in the GAC.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents