.netgacstrongnameazman

azman - problem with registering Interop.AZROLESLib.dll to GAC


I am struggling since 2 -3 hours to register the Interop.AZROLESLib.dll to gac using .net framework configuration tool. the error says "unable to add the selected assembly. the assembly must have strongname.....". Please help to create strong name and other stpes.

Thanks


Solution

  • For more detail : http://aspalliance.com/394_Installing_an_Assembly_in_GAC.all

    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 tag (for web apps,under ////) Between the tags, enter:

    <add assembly="AssemblyFileName, Version=0.0.0.0, Culture=neutral, PublicKeyToken=5edf592a9c40680c" />