How do I force an assembly to uninstall from the G

2019-02-28 10:08发布

I've developed a simple installation package using WiX that installs an assembly called WBRT.Configuration into the Global Assembly Cache (GAC). While the file installs, it is not removed when the package is uninstalled.

I've tried running a command prompt as administrator, used msiexec /x specifying the msi filename and msiexec /x specifying the product code.

With the /l*v switch, there is no error:

Executing op: ActionStart(Name=MsiUnpublishAssemblies,Description=Unpublishing assembly information,Template=Application Context:[1], Assembly Name:[2]) Executing op: AssemblyUnpublish(,,AssemblyType=1,,AssemblyName=WBRT.Configuration,version="1.0.0.0",culture="neutral",publicKeyToken="361AD75BADC53912",processorArchitecture="MSIL",Descriptor=2-(xWui~z@UnhQuo-~Gh>S.OwM9Kim9x0ul%Ore=9) Executing op: ActionStart(Name=UnpublishFeatures,Description=Unpublishing Product Features,Template=Feature: [1])

WiX File element

<File Id="filB7155C3E9A241BEAFE09533364964732" KeyPath="yes" Assembly=".net" Source="$(var.Configuration.TargetDir)\WBRT.Configuration.dll" />

MsiAssemblyName table in Orca

MSIAssemblyName

File in the GAC

File in GAC

Version tab of the file in the GAC

Version

I'm completely stumped. Does anyone have ideas?

2条回答
不美不萌又怎样
2楼-- · 2019-02-28 10:40

First, verify that your assembly is not locked by another process via gacutil.exe

gacutil /u WBRT.Configuration

If the above is OK make sure the file parent container has no permanent flag - Permanent="no"

<Component Shared="yes" Permanent="no" Guid="PUT-GUID-HERE" >
    <File Id="filB7155C3E9A241BEAFE09533364964732" KeyPath="yes" Assembly=".net" 
       Source="$(var.Configuration.TargetDir)\WBRT.Configuration.dll" />
</Component>
查看更多
Explosion°爆炸
3楼-- · 2019-02-28 11:02

I followed the steps mentioned by @Mohsen , Remove the registry entry and uninstalled the DLL from GAC to resolve a conflict issue.

[HKLM\SOFTWARE\Classes\Installer\Assemblies\Global] and run gacutil /u dllname -And success. I do not know what is the side effect. It worked for me, then I ran

gacutil -u dllThatIWantedToRemove

查看更多
登录 后发表回答