Monthly Archives: November 2011

Viewing the GAC

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:

The Global Assembly Cache

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:

  1. 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
  2. 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.
  3. 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.

Move Your Desktop Off Your System Drive

This is a post I have been meaning to write for a while.

Firstly, if you have your data on the same drive as your operating system, you’re doing it wrongly. If you only have the 1 drive, you should partition it so that your data is on a separate partition to your OS. But this post assumes you have already figured that out and are already doing it.

This post is about moving the contents of your Desktop* onto your data drive (or partition, as the case may be). I have noticed many people leave their desktop on their System drive. As this directory is one which is written to and read from more than most, it needs to be on your data drive/partition.

Achieving this is really easy. First, open Windows Explorer and in the file bar (the part where you type in file locations), enter %USERPROFILE%. Then, right-click on the Desktop folder and click the location tab.

Click the Move button to move your Desktop

There is a move button there which allows you to move the contents from the current location of the Desktop folder to the new one which you choose on this tab.

Note that you can do the same for your other main libraries, like your Music, Videos, Downloads etc.

This practice reduces the clutter on the partition in which your OS is running, and in doing so, will make for a happier machine.

* That big expanse above the start button, with the wallpaper image of the wife and kids.