Hannes Pavelka
It isn't rocket science. Well, unless of course you're NASA

Windows Explorer and the Global Assembly Cache (GAC)

Friday, May 05, 2006 6:19 AM

As you probably know shared assemblies are stored in the global assembly cache (GAC) which is located at c:\windows\assembly.If you navigate to this folder you might be surprised to see that is looks a lil different then you might expect. 

 

What you actually see in the windows explorer is an aggregated view of different folders. Open up a dos prompt and navigate to c:\windows\assembly

Technically a shell namespace extension is used to achive this. With the help of a shell namespace extensions you can create some custom functionality for Windows Explorer. One common use is to enable Explorer to present a list of items that do not exist in one real folder, but actually reside in a number of places. The view on the folder makes it look like these items are in one place, so managing them becomes easier.

The shfusion.dll is used to provide the user interface you see in explorer. If you disable the namespace extensions explorer is using the default extension to display the content of the gac.

Three ways to disable the namespace extension:

1. Rename the Desktop.ini

What you can’t see from the screenshot above is that there is a hidden file called Desktop.ini which is invoking the namespace extension.
You could rename the file with the following commands:

attrib desktop.ini -h -r -s
rename desktop.ini desktop.ini.bak

2. Add DisableCacheViewer Registry Key

Another way to disable to create a new dword key under HKLM\Software\Microsoft\Fusion\ with the nane DisableCacheViewer and set it’s [DWORD] value to 1.

3. Rename the Shfusion.dll

Last but not least you could rename the Shfusion.dll which is located in the %windir%\Microsoft.NET\Framework\vx.x.xxxx folder, where xxxx is the build number of the .NET Framework you are using.

Plain old explorer view

If you open windows explorer after one of the above procedures you will see your familiar folder structure.

 Once you disabled the namespace extension you no longer have drag and drop support for installing assemblies to the gac. Thus you probably want to re-enable the namespace extension once you have looked around.


Feedback

# re: Windows Explorer and the Global Assembly Cache (GAC)

The 'Assembly' directory is not the only one Explorer screws around with.
It also hides the DLLCache directory so that you can not replace 'system' dlls with different versions - something you sometimes need to do when debugging a customer problem.

One solution to this is to dump Windows Explorer altogether and use a real file manager like the one in Norton NT Tools. Unfortunately Symantec no longer sell this product, but if you can find a copy it works very well ... and gives you a lot of other useful features that Microsoft dont provide.
I use this product 99.9% of the time. (even though it is 12 years old!) The one problem that forces me to use Explorer (temporarily) is when I need to copy a file and the space in use is close to a 4GB boundary. (In 1996 there was no support for drives larger than 4GB so the app thinks my 120GB drive is full.)

One more warning - if you are one of those strange folks who actually likes to store all their files under 'My Documents', that is also a 'fake' directory ... so you have to navigate to the 'real' directory instead - about 3 levels down from the top ... so not very convenient.
4/2/2008 10:16 AM | Mike Dempsey

# re: Windows Explorer and the Global Assembly Cache (GAC)

easiest way is run this command from run prompt...

SUBST L: "C:\Windows\assembly"

then navigate to your L: drive in explorer, or whatever you named it. 9/8/2008 2:38 AM | Jason

# re: Windows Explorer and the Global Assembly Cache (GAC)

And another way is to open Visual Studio Command Prompt and run regsvr32 -u shfusion.dll. 10/6/2008 9:46 PM | Anton Swanevelder

Post a comment





 

Please add 5 and 6 and type the answer here: