Uninstall an assembly from the GAC: Access Denied


If you’ve encountered this problem, you probably did a Google search. You must have noticed there isn’t alot of solutions which have worked for you. Here’s something that has worked for me.

In the command prompt, I executed the following code:

1
2
3
4
5
6
cd /d %windir%\assembly 
attrib -r -h -s desktop.ini 
mkdir gacview 
move desktop.ini gacview 
attrib +s gacview 
attrib +r +h +s gacview/desktop.ini

Source: http://blogs.msdn.com/b/cumgranosalis/archive/2005/10/03/476275.aspx

This code allows you to browse the GAC as in Windows Explorer instead of the GAC viewer. The second portion of the script creates a folder named “gacview” in the assemble folder, which allows you to browse the GAC in the old fashion way. This way, you retain the advantages of both world.

Once you can browse the GAC with Windows Explorer, you can find your assembly, and manually delete it, and no security will prevent you from doing so.

I don’t know if there are repercussions to this, I don’t know if it’s a good practice or not. My guts tell me it’s a hack, so it’s probably not a good practice, but it’s the only thing that worked for me.

, , ,

Comments are closed.