Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to uninstall a DLL from the C:\Windows\Assembly "folder" on Windows Server 2008, but am getting a "permission denied" error. How do I go about removing a DLL without uninstalling the entire application?

An application vendor has sent me new DLL's, with no instructions on how to remove the old version or add these new ones. Google hasn't been as helpful as usual, either...

share|improve this question
    
I am not sure, but perhaps you need to unregister it with regsrv32 and register the new one? Make sure try to use that from an elevated shell. –  Zoredache Sep 1 '10 at 22:20
    
This was on a 64-bit server, so that didn't work, either. Using \windows\syswow64\regsvr32 c:\filename.dll may be an option. –  SturdyErde Sep 1 '10 at 22:24
1  
Using regsvr32.exe or \windows\syswow64\regsvr32.exe would be an option for most DLL's, but I don't think it can uninstall from the GAC. I have posted my solution below. –  SturdyErde Sep 1 '10 at 22:30

3 Answers 3

up vote 3 down vote accepted

This didn't work before, but thankfully did on my last attempt. Go figure...

I found gacutil.exe on the server and ran gacutil -u dllName.DLL Installing the new DLL was simply gacutil -i "PathAndFilenameOfNewDLL"

http://msdn.microsoft.com/en-us/library/zykhfde0%28VS.80%29.aspx

share|improve this answer

Put gacutil /u in a cmd file and run by right clicking and selecting Run As Administrator. This worked where everything else suggested failed.

share|improve this answer

I know I'm late to the party, but here is another solution using Powershell if you do not have gacutil.exe present. Gacutil is a development tool and normally isn't present on production systems.

Fire up PowerShell using an elevated prompt by right-clicking on it and selecting "Run As Administrator." Then type or copy/paste the following:

$pathToFile = 'PathAndFilename.dll'
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacRemove($pathToFile)

If you want to install a copy to the GAC, change the last line to this:

$publish.GacInstall($pathToFile)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.