The GAC or global assembly cache is a system-wide store of shared assemblies. It is meant to solve issues such as DLL Hell but a word of caution: avoid storing your assemblies in the GAC unless you have a solid and compelling reason to do so. I digress; this post is not meant to be a when you should versus when you should not store assemblies in the GAC, rather it will serve as a peek under the hood.
The GAC is implemented by the .NET Framework as a set of directories under %SystemRoot%\assemblies. The layout is as such:
| \GAC | v1.1 assemblies |
| \GAC_32 | v2.0 assemblies with 32-bit affinity |
| \GAC_64 | v2.0 assemblies with 64-bit affinity |
| \GAC_MSIL | v2.0 assemblies without bitness affinity |
| \NativeImages1_v1.1.4322 | ngen of v1.1 assemblies |
| \NativeImages_v2.0.50727_32 | ngen of v1.1 assemblies with 32-bit affinity |
| \NativeImages_v2.0.50727_64 | ngen of v1.1 assemblies with 64-bit affinity |
| \temp | temporary storage |
| \tmp | temporary storage |
Under the GACxxx directories live a subdirectory for each assembly added to the GAC (in the format: NameOfAssembly; e.g. System.Transactions).
Under these directories live a directory for each version + strong name combination (in the format: AssemblyVersion__PublicKeyToken e.g. 2.0.0.0__b77a5c561934e089).
Under these directories lives the actual assembly files (e.g. System.Transactions.dll).
Not so bad of a monster is it?
0 comments:
Post a Comment