AssemblyKeyFile
suggest changeAn 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:
- Open the Developer Command Prompt for Visual Studio (with administrator access).
- At the command prompt, type
cd C:\Directory_Nameand press Enter. - At the command prompt, type
sn -k KeyFileName.snkand 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents