What is the .NET Global Assembly Cache (GAC)?
Posted: (EET/GMT+2)
The Microsoft .NET Framework contains many useful features, despite being only at version 1.0. If you are developing with the .NET Framework already, you may encounter the Global Assembly Cache (GAC) when deploying shared components.
The GAC is a machine wide repository for .NET assemblies that are shared by multiple applications. This means that not all applications need their own copy. The idea is basically this:
Application A > Application B > GAC > Shared Assembly
Assemblies installed into the GAC must have a strong name. This uniquely identifies the assembly and allows multiple versions to exist on the same computer.
You can install an assembly into the GAC using the Global Assembly Cache tool:
gacutil /i MyLibrary.dll
To list installed assemblies:
gacutil /l
Applications that use private assemblies continue to store them in the application's bin directory. The GAC should be reserved for components that are shared across multiple applications.
The Global Assembly Cache helps avoid version conflicts that are common with shared COM components.
Hope this helps!