What is the GAC in .NET?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
The Global Assembly Cache (GAC) is a central repository for .NET assemblies that are shared across multiple applications on a computer. The concept of the GAC was introduced with the .NET Framework to provide a way for common libraries to be easily accessible without the need for multiple copies across different application directories.
Purpose of the GAC
The GAC serves several critical functions:
- Versioning Control: It permits multiple versions of the same library to coexist, thus preventing the "DLL Hell" problem where applications could break due to incompatible library versions.
- Shared Libraries: Assemblies that are intended for shared use across different applications can be stored in the GAC, promoting reusability and reducing redundancy.
- Security and Identity: GAC ensures assemblies have a strong name, providing security by requiring that libraries are uniquely identified.
How the GAC Works
Strongly Named Assemblies
To be stored in the GAC, assemblies must have a strong name. A strong name consists of the assembly’s identity — which includes its simple text name, version number, culture information (if provided) — plus a public key and a digital signature generated based on the assembly's contents. This ensures that even if the assembly's contents change, its identity remains unique and verifiable.
Installing Assemblies in the GAC
To install an assembly, developers typically use tools like:
- GACUtil: This command-line utility is used for installing and managing assemblies in the GAC.
- Example command to add an assembly:
- Limited to .NET Framework: The concept of GAC is specific to .NET Framework and is not applicable to .NET Core or .NET 5/6+.
- Admin Rights Required: Installing or removing assemblies in the GAC requires administrative access.
- Strong Names Only: Only strongly named assemblies can be placed in the GAC, potentially requiring additional setup like key pair generation.
Related reading
- What is the ideal number of partitions in kafka topic?
- What is the impact if delay kafka manual commit offset?
- what is the key difference between multipaxos and basic paxos protocol
- What is the maximum replication factor for a partition of kafka topic
- What is the Java equivalent for LINQ?
- What is the major use of MarshalByRefObject?
- what is the meaning of Distributed word in Distributed Version Control System like Git?
- What is the proper use of Tensorflow dataset prefetch and cache options?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.