1 / 11

Global Assembly Cache (GAC)

Global Assembly Cache (GAC). What is GAC. Repository containing all the assemblies of CLR Machine wide Assemblies shared by several applications Where CLR is installed C:WindowsMicrosoft.NETassemblyGAC_MSIL. Why we have to use GAC. Adding again and again assembly in different project

Download Presentation

Global Assembly Cache (GAC)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Global Assembly Cache (GAC)

  2. What is GAC • Repository containing all the assemblies of CLR • Machine wide • Assemblies shared by several applications • Where CLR is installed • C:\Windows\Microsoft.NET\assembly\GAC_MSIL

  3. Why we have to use GAC • Adding again and again assembly in different project • Shared location • File security • Side by side versioning (under consideration) • Additional search location

  4. How to install an assembly in GAC • Install by using the gacutil.exe tool • Recommended for developers • Install by using GUI interface of Windows installer

  5. How to make an assembly(.dll) • Create a library project in Visual studio • Add some functions • To sign an assembly with a strong name • public/private key pair • Use this command to make a key • sn -k <keyname>.snk • It creates a key pair file “keyname.sn”

  6. How to make an assembly(.dll) cont… • Put the key file in library project

  7. How to install an assembly(.dll) Method -1 • Open Visual Studio Command Prompt • Use this command to register assembly • gacutil.exe –i myassembly.dll • It creates the folder with assembly • C:\Windows\Microsoft.NET\assembly\GAC_MSIL

  8. How to install an assembly(.dll) Method -2 • Create a new setup project in same solution • Drag the assembly to the GAC folder • Build the setup project and install it • It creates the folder with assembly • C:\Windows\Microsoft.NET\assembly\GAC_MSIL

  9. How to register an assembly(.dll) cont… • Open registry and go to this path • Create a registry key with assembly location • For 32 bit • [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx\MyAssemblies]@="AssemblyLocation“ • [HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx\MyAssemblies]@="AssemblyLocation"

  10. How to register an assembly(.dll) cont… • For 64 bit operating system • [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx\MyAssemblies]@="AssemblyLocation" • [HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\VersionMinimum\AssemblyFoldersEx\MyAssemblies]@="AssemblyLocation“

  11. Use assembly in Visual Studio • Assembly is created under .NET column • Just right “using assembly name;” and enjoy 

More Related