The GAC is located in C:\WINDOWS\assembly (“the GAC Folder”) on standard installations, and a screenshot of that directory in Windows explorer looks like this:
That “magical” view of the GAC Folder is pulled off by shfusion.dll (“the Viewer”), located in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\. As you can see from viewing the directory at the command prompt, the actual contents of the GAC Folder are somewhat different:
I recently had cause to seek out the actual dll for mscorlib, and the magical view of the GAC Folder was not of much use to me. After a bit of hunting around, I found a couple of ways of exposing the actual dlls in the GAC:
- you can uninstall/disable the Viewer. I consider this to be a really bad idea (even though you can re-install/enable it fairly easily). But I want to record it here (for future reference). Using “the run command” in the Start menu, run the following: regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll To re-install, run: regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll
- the good old SUBST command. This old DOS command substitutes paths on physical and logical drives as virtual drives. To make the GAC Folder available by bypassing the Viewer, you can enter subst x: C:\Windows\assembly and you will find an “x” drive in your drives folder which exposes the GAC Folder’s contents, but not through the prism of the Viewer. To “unmount” that virtual drive, you can enter subst x: /D.
- you can alter the Registry (not for the faint-of-heart). To do this, bring up the regedit snap-in by entering regedit at the run command. Add a new DWORD under the key HKEY_LOCAL_MACHINE/Software/Microsoft/Fusion called DisableCacheViewer and set it value to 1. (By setting it to 0, the viewer will become enabled again).
For me, turing off the Viewer is only ever a temporary thing. I went with option 2, as I believe this to be the safest approach. I think there are a few other ways to bypass the view of the GAC which the Viewer presents, but you really start getting into some horribly wrong hacks, which I did not think had merit enough to mention here.