Registering an Assembly in the GAC
Registering an Assembly in the GAC
1) Create an assembly key file Use the sn.exe tool to create a key file: sn -k StrongNameFile.snk If your path environment variables aren't set, you'll have to go to the C:\Program Files\Microsoft.NET\FrameworkSDK\Bin\ directory to run sn.exe) The filename "StrongNameFile.snk" can be any name you want.
2) Edit your assembly Now you have to add a tag which will link your assembly key to the assembly: using System.Reflection; [assembly:AssemblyKeyFile("StrongNameFile.snk")] Normally this is done in the utility AssemblyInfo.cs (vb) file.
3) Add your assembly to the GAC gacutil /i AssemblyFileName.dll To uninstall this assembly from the GAC, use the command: gacutil /u AssemblyFileName
4) (Opional) Add your assembly to machine.config Locate the
Happy Programming
0 Comments:
Post a Comment
<< Home