Global Assembly Cache (GAC)
The Common Language Runtime (CLR), when installed on a computer, introduces a significant component known as the 'Global Assembly Cache' (GAC). This machine-wide code cache acts as a designated folder, residing within the Windows directory, that serves as a repository for .NET assemblies explicitly intended for shared utilization across all applications running on the system. By registering assemblies in the Global Assembly Cache (GAC), they can be seamlessly shared among multiple applications on the machine, promoting code reuse and avoiding duplication.
The GAC is an integral part of the .NET runtime and is automatically installed alongside it. It assumes its position within the 'Windows/WinNT' directory and inherits the access control list (ACL) of the directory, thereby adhering to the protective measures administrators have put in place.
DLL hell
The establishment of a carefully controlled central repository, embodied by the Global Assembly Cache, effectively addresses the challenges associated with shared libraries. This approach helps mitigate issues such as the notorious "DLL hell," where conflicting or incompatible versions of DLLs could cause conflicts or inconsistencies in application execution.
Where is GAC (Global Assembly Cache) located?
GAC is located in %windir%\assembly (for example, C:\WINDOWS\assembly) and it is a shared repository of libraries.
How to view the Contents of the Global Assembly Cache?
At the Visual Studio command prompt, type the following command:
Conclusion
To facilitate the management of the Global Assembly Cache, Microsoft provides the Global Assembly Cache Tool (Gacutil.exe). This tool empowers developers and administrators to inspect and manipulate the contents of the GAC, granting them the ability to add, remove, or update assemblies within the cache as needed.
- What is Microsoft .Net Framework
- what are the functions of microsoft .net framework?
- Common Language Runtime in .Net Framework
- How Does CLR Work In Dot NET Framework
- What is .Net Framework Class Library
- What is Common Language Specification
- What is Common Type System
- What is Microsoft Intermediate Language
- What is Portable Executable (PE) File Format
- What is Microsoft Just In Time Compiler
- How to Managed Code - Microsoft .Net Framework
- What is .Net Framework Metadata
- what is .Net Framework Assembly
- What is Assembly Manifest
- What is a .Net Satellite Assembly?
- What are the contents of an Assembly?
- How to Private Assembly and Shared Assembly
- What is Microsoft .Net Strong Name
- What is .Net Namespaces
- What is Application Domain
- What is Code Access Security
- What is Garbage Collection
- .Net Threads