ReBuildAll Blog
Thoughts (mostly) on .NET development

Global Assembly Cache in .NET 4.0   (Framework)   
I was looking for assemblies in the GAC for .NET 4.0, and I just could not find them. As it turns out, I was looking in the wrong place. The usual C:\WINDOWS\assembly folder does not help any longer: it only lists DLLs from prior versions of the .NET Framework.

That is just sad. It was very convenient to install and uninstall assemblies from the GAC by dragging them to this folder in Explorer, or right clicking and choosing uninstall. You did not need gacutil.exe or MSI files to perform such an operation. This was all made possible by a shell extension, shfusion.dll that was included with .NET 2.0 (and so worked for 2.0, 3.0, 3.5)

Now, shfusion.dll is discontinued - no longer shipped with .NET 4.0. So how can you manipulate the GAC?

You can still use the gacutil.exe -l, but that is only included with the SDK. And you need to run it from the Visual Studio Command Prompt, or make sure you know the path for it.

Or you can build MSI files.

For .NET 4.0, the actual folder is located at: C:\WINDOWS\Microsoft.NET\assembly

But there is no magic any longer: it is just a regular folder. In fact, if you have ever visited the old assembly folder from the command prompt, you will feel right at home - you don't see the assemblies in a unified view, rather the raw folders that they are stored in. Separate folders for x86 and x64 architecture (native images) and MSIL.

I think this was a bad idea. The old kind of way for viewing assemblies worked great. In fact, it was possible to troubleshoot issues with the IT department very easily: they could grasp the idea of drag-and-dropping folders into Windows Explorer. No need to know inside things about .NET. Easy. Now they have to run command line tools or I have to create installers. Hard. Bad bad decision :(

PS/Update: If anyone knows easy ways to achieve this in 4.0, or I just overlooked something, please feel free to comment. I am almost certain there are PowerShell commandlets to help us out, but haven't had time to investigate.

 

Comments

KOT Re: Global Assembly Cache in .NET 4.0
Try:

http://www.nirsoft.net/dot_net_tools/gac_viewer.html
Re: Global Assembly Cache in .NET 4.0
I, too, find this tremendously irritating--I'd gotten in the habit of checking c:\Windows\Assembly to verify that my product's installer behaved correctly. Now I have to go poking around the hard drive or bring up a command window and hammer out a bunch of gacutil commands.

I'm sure they had a reason for discontinuing this, but lately I feel like a lot of MS decisions that are "the right way to do things" haven't been thought through very well ("Blurry fonts in WPF are better! Look how smoothly they scale!")
Lenard Gunda Re: Global Assembly Cache in .NET 4.0
All that Connect post tells us is that the new GAC folder is visible as the raw folders that are on disk - I verified that it works this way in Windows Explorer with the released version of .NET 4.0 and 3.5 installed on the same box.

So the complaint remains: no easy way to manage the GAC (for .NET 4.0), need to use other tools / command line / PowerShell / etc. :-(
Carlos Loth Re: Global Assembly Cache in .NET 4.0
According to this Microsoft Connect post http://connect.microsoft.com/VisualStudio/feedback/details/525646/net-framework-4-beta-2-global-assembly-cache-viewer-causes-memory-corruption the shfusion.dll was discontinued beginning on .NET Framework 4.0 release. Check the second comment from Microsoft staff.
Thogek Re: Global Assembly Cache in .NET 4.0
I'm looking around, but...
Have we seen any word from Microsoft on why this (IMO, odd) change?
Re: Global Assembly Cache in .NET 4.0
Nice that someone speaks this out. Have looked around. Binged, then Googled ;) Didn't find my new assemblies.
Only this similar called directory tree :) The .NET 4 documentation (Tools) on MSDN still tells you there is a shfusion.dll.

Will the NET5 gac be %windir\microsoft.net\v5.x\assembly\gac ? :P