The
Global Assembly Cache or
GAC is a machine-wide
.NET assemblies cache for
Microsoft's
CLR platform. The approach of having a specially controlled central repository addresses the
shared library concept and helps to avoid pitfalls of other solutions that lead to drawbacks like
DLL hell.
Requirements
Assemblies residing in the GAC must adhere to a specific versioning scheme which allows for side-by-side execution of different code versions. Specifically, such assemblies must be
strongly named.
Usage
Microsoft provides two ways to interact with the GAC: the Global Assembly Cache Tool (gacutil.exe) and the Assembly Cache Viewer (shfusion.dll).
Global Assembly Cache Tool
gacutil.exe is an older command-line utility that shipped with .NET 1.1 and is still available with the .NET SDK.
One can check the availability of a shared assembly in GAC by using the command:<pre>gacutil.exe /l <assemblyName></pre>
One can register a shared assembly in the GAC by using the command:<pre>gacutil.exe /i <assemblyName></pre>
Or by copying an assembly file into the following location:<pre>%windir%assembly</pre>Note that for .NET 4.0 the GAC location is now:<pre>%windir%Microsoft.NETassembly...</pre>
Other options for this utility will be briefly described if you use the /? flag, i.e.:<pre>gacutil.exe /?</pre>
Assembly Cache Viewer
The newer interface, the Assembly Cache Viewer, is...
Read More