Why aren't all the assemblies in the GAC built like MSIL?

What is the reason that not all assemblies in the global assembly cache (GAC) are built as MSIL ? I see the x86 and AMD64 architecture types used for some assemblies, as in the example below, but not for others:

C:\Windows\assembly\

enter image description here

Why is System.Data built for two different processor architectures and System.Core is MSIL ?

C:\Windows\Microsoft.NET\assembly

enter image description here

A similar model can be seen in the second version of the GAC, shown above. Assemblies are divided into different architectures, but not all of them are built-in in version 32/64 - some of them are just MSIL .

+7
gac gac-32 gac-64 gac-msil
source share
1 answer

When you compile your library, you can choose to target either "Any processor" or a specific processor architecture.

Any processor libraries only require one entry in the GAC, and the entire assembly is compiled in MSIL.

Other assemblies need a separate library for each architecture. These libraries are built for each type of CPU, and there are several copies in the GAC. The most common reason is to include unmanaged code or load your own DLL, which is architecture specific.

In your example, System.Core is probably fully managed code, while System.Data is probably built on top of many of its own Windows libraries.

Applications running in 32-bit mode download the 32-bit version of the library, while applications running in 64-bit mode download the 64-bit version.

+7
source share

All Articles