2
votes

I have an old version of the Enterprise Library in GAC. It resists any attempt on its life made with GACUTIL.EXE claiming the following:

Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved.

Assembly: Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c, processorArchitecture=MSIL
Unable to uninstall: assembly is required by one or more applications
Pending references:
SCHEME: <WINDOWS_INSTALLER> ID: <MSI> DESCRIPTION : <Windows Installer>
Number of assemblies uninstalled = 0 Number of failures = 0

I found some explanation on the subject here, but I can’t find any relevant registry keys.

So I want the nuclear option. Whose got one?

2
Is reinstalling the OS viable? that's pretty much a nuke solution.Zach M.
The assembly was put into the GAC by an installer. You should remove it by running the uninstaller for the product that needs this assembly. Or consider to not intentionally break that machine, the only proper advice. stackoverflow.com/a/2447331/17034Hans Passant
If you are ok with applications that might/might not work you can manually delete the folders as well. %windir%\Microsoft.NET\assembly, find the assembly folders and then delete them. I would not recommend it but it's not my machine so have at it.Igor

2 Answers

0
votes

Have You tried this? It may work since I don't think it's using GacUtil:

Using the Windows interface

Navigate to the GAC, which is located at %systemdrive%\Windows\Assembly.

Right-click each assembly file that is included in your application, click Uninstall, and then click Yes to confirm.

MDSN Docs

I found something else, look at this too: MS Support

1
votes

Had the exact same problem with the OpenXml SDK Productivity Tool which only exists in version 2.5 but not in the latest 2.8.1.

After updating the SDK for my ASP.Net webpage in Visual Studio using Nuget Package Manager I had the problem that during the publish process the old "DocumentFormat.OpenXml V.2.5" dll was published and not the new one (which was referenced correctly in my Visual Studio project).

So I decided to uninstall the old SDK first by using the "Programs and Features" page and afterwards the "Uninstall"-Option of the MSI installer file.

Neither of it worked. Somehow the dll remains in the GAC and in the Registry. I tried to uninstall it using GACUTIL.exe, but I got the above Message:

    Unable to uninstall: assembly is required by one or more applications
Pending references:
SCHEME: <WINDOWS_INSTALLER> ID: <MSI> DESCRIPTION : <Windows Installer>

Then I deleted the registry key value for (ONLY THE VALUE, NOT THE KEY ITSELF)

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global
DocumentFormat.OpenXml,version="2.5.5631.0",culture="neutral",publicKeyToken="31BF3856AD364E35". 

And that worked for me. Afterwards the correct dll is published! Hope it helps someone!