Question

We are using the GAC in our project, and while in development, we often have to unregister the previous versions of our DLLs before registering the fresh ones. While we can use GACutil.exe to do so, we can also drag & drop our DLLs to C:\Windows\assembly to register them, and right-click + Uninstall to unregister them (or sometimes we do it in the command prompt with "del" and the names of the DLLs).

My question: is there any indication against our way of doing things? Is it equivalent to "GACUtil -i" and "GACUtil -u", or it can lead to problems ?

Thank you,

Was it helpful?

Solution

This functionality is provided by a custom shell extension, shfusion.dll. It flattens the GAC and makes it look like a single folder. And takes care of automatically un/registering the assemblies for you when you manipulate the explorer window. So you're fine doing this.

Note that this will no longer work for .NET 4, it uses a GAC in a different folder (c:\windows\microsoft.net\assembly) and that folder does not have a the same kind of shell extension, you see the raw content of the GAC folders. Don't mess with that one.

It general, you should not use the GAC on your dev machine like that. For one, the point of using it is to allow multiple versions of an assembly to co-exists so constantly un/registering doesn't make sense. For another, it doesn't make a lot of sense to keep changing the [AssemblyVersion] while you are developing. Strongly favor the Copy Local feature supported by the IDE. Putting it in the GAC can be useful on your user's machine. Also the reason, I think, that Microsoft isn't supporting the shell extension anymore. It got used too often :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top