«

»

Jul 11

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:

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

Sources:
Uninstall an assembly from the GAC: Access Denied
That annoying c:\windows\assembly folder

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 assembly 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>