WHAT IS GAC? WHAT ARE THE STEPS TO CREATE AN ASSEMBLY AND ADD IT TO THE GAC?

Varun Agrawal

Total Post:159

Points:795
Posted by  Varun Agrawal
.NET 
 1569  View(s)
Ratings:
Rate this:
  1. Varun Agrawal

    Post:159

    Points:795
    What is GAC? What are the steps to create an assembly and add it to the GAC?

    The global assembly cache (GAC) is a machine-wide code cache that stores assemblies specifically designated to be shared by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to.
    Steps
    - Create a strong name using sn.exe tool eg: sn -k mykey.snk
    - in AssemblyInfo.cs, add the strong name eg: [assembly: AssemblyKeyFile("mykey.snk")]
    - recompile project, and then install it to GAC in two ways :
    ·         drag & drop it to assembly folder (C:\WINDOWS\assembly OR C:\WINNT\assembly) (shfusion.dll tool)
    ·         gacutil -i abc.dll

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!