.Net Tips – Finding GAC

By default the GAC fold­er in Win­dows is locat­ed at %windir%\assembly, you can find all the reg­is­tered DLLs in that fold­er. Whilst you can open it in win­dows explor­er and view it like any oth­er fold­er, it is a some­what spe­cial and allows you to have dif­fer­ent ver­sions of the same DLL reg­is­tered in the GAC. 

Open up DOS prompt and nav­i­gate to the GAC fold­er, for instance:

image

and you can see that the GAC is actu­al­ly a fold­er inside the assem­bly fold­er, and drilling a lit­tle deep­er reveals that each DLL has its own fold­er which con­tains all the reg­is­tered ver­sions, each as a fold­er that con­tains the actu­al DLL inside:

image 

image

image

.Net 4

For .Net 4, the GAC loca­tion is now %windir%\Microsoft.Net\assembly.

Glob­al Assem­bly Cache Tool

You can use gacutil.exe from the com­mand line to view (e.g. gacu­til /l), add (e.g. gacu­til /i SomeAssembly.dll) or remove (e.g. gacu­til /u Some­Assem­bly) the con­tents of the GAC, this of course, sup­ports mul­ti­ple ver­sions of the same assem­bly too.