tags:

views:

226

answers:

7

Is the GAC a memory area or hard disk area (C:\windows\Microsoft.NET\Assembly\...) I am confused by the word cache in GAC?

+8  A: 

GAC is a folder:

C:\Windows\Microsoft.NET\assembly

The assemblies stored in the folder(s) under that folder are in the GAC. You add assemblies to the GAC by signing them, then using gacutil to add them. The GAC is one of the locations a managed assembly will look for any external references.

Dave Swersky
It's backing storage is a folder, but you don't want to mess with it by hand. For a pretty good overview of how the GAC works you might want to check out the book CLR via C# by Jeffrey Richter.
Funroll Loops
+3  A: 

The GAC itself is a located on the hard disk at %systemroot%\Assembly.

Obviously, the binaries themselves are loaded to memory at runtime.

The cache in GAC semantically refers to a general repository for binaries.

Yuval A
Meh. “cache” means having a transparent loading mechanism to hide (hence the name “cache” from french “cacher”) costly loading of data from the client who is accessing the data as if it were uncached. No reference to binaries.
Konrad Rudolph
@Konrad - "The cache in GAG..." makes it pretty obviously about this specific case, not a statement about the general meaning of the term cache.
Daniel Earwicker
First few definitions in the dictionary: "hiding place", "hoard", "store". Quite appropriate for GAC behavior.
Hans Passant
A: 

As mentioned already the GAC is the location on the harddisk (%systemroot%/assembly). In this context the term cache refers to the storage of goods, so this is a common location where strongly named versioned assemblies are stored and accessed by .NET applications.

Chris Taylor
+1  A: 

GAC is stored physically on your hard drive. You can see physical files from command line using this:

dir %WINDIR%\assembly\GAC_32
Boris Modylevsky
A: 

The Global Assembly Cache (GAC) is located on your hard drive, by default C:\Windows\Assembly, and I also noticed after verification that you may also have libraries at C:\Windows\Microsoft.NET\GAC_[XX], where [XX] stands for 32 or 64 bits or MSIL (Microsoft Intermediate Language) assuming your system drive is C:.

You can follow the links referenced to learn more.

Will Marcouiller
+2  A: 

A cache is any mechanism which improves the response time of loading data without the client having to take further actions: the client is requesting the data in the “normal” way and the cache basically intercepts these requests and may on occasions deliver data without having to forward the request to the actual data provider.

This isn’t in any way specific to memory based. Caches exist for various scenarios, on the CPU to improve access time of the RAM, in web browsers to improve access time of web resources – and, in this case, as a folder of precompiled assemblies on disk to improve accessing DLLs (which otherwise would have to be compiled).

Konrad Rudolph
A: 

GAC is on disk. Imagine keeping all the signed assemblies in memory...

Kai Wang