What is the reason that not all of the assemblies in the Global Assembly Cache (GAC) are built as MSIL
? I see x86
and AMD64
architecture types used for some assemblies, as in the example below, but not for others:
C:\Windows\assembly\
Why is System.Data
built for two different processor architectures, while System.Core
is MSIL
?
C:\Windows\Microsoft.NET\assembly
A similar pattern can be seen under the second version of GAC, shown above. Assemblies are split into different architectures, but not all of them are built into 32/64
versions -- some are just MSIL
.
GAC Folder The folder path used by .NET Framework 4.0 (and above) is C:\Windows\Microsoft.NET\assembly\GAC_32 (32 bit only) C:\Windows\Microsoft.NET\assembly\GAC_64 (64 bit) C:\Windows\Microsoft.NET\assembly\GAC_MSIL (32 and 64 bit) The MSIL is an abbreviation for Microsoft Intermediate Language.
To install an assembly in the GAC, you must give the assembly a strong name. The name is a cryptographic hash-key, or signature. This strong name ensures correct component versioning.
All assemblies provided by Mono are stored in the GAC.
The 4.0 GAC is at C:\Windows\Microsoft.NET\assembly . You'll find the various types of assemblies divided up into their 32-bit, 64-bit, or MSIL subdirectories under that folder.
When you compile your library you can choose to target either "Any CPU" or a specific processor architecture.
The "Any CPU" libraries only need a single entry in the GAC and the entire assembly is compiled to MSIL.
Other assemblies need a different library for each architecture. These libraries are built for each CPU type and there are multiple copies in the GAC. The most common reason is to include unmanaged code or load a native dll which is architecture specific.
In your example System.Core is probably fully managed code whereas System.Data is probably built on top of a bunch of native windows libraries.
Applications running in 32bit mode will load the 32bit version of the library whereas applications running in 64bit mode will load the 64bit version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With