如何强制从GAC卸载程序集? [英] How do I force an assembly to uninstall from the GAC?

查看:126
本文介绍了如何强制从GAC卸载程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WiX开发了一个简单的安装程序包,该程序包将名为WBRT.Configuration的程序集安装到全局程序集缓存(GAC)中.在安装文件时,在卸载软件包时不会将其删除.

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.

我尝试以管理员身份运行命令提示符,使用msiexec/x指定msi文件名,使用msiexec/x指定产品代码.

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

使用/l * v开关,没有错误:

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])

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 Id="filB7155C3E9A241BEAFE09533364964732" KeyPath="yes" Assembly=".net" Source="$(var.Configuration.TargetDir)\WBRT.Configuration.dll" />

Orca中的MsiAssemblyName表

GAC中的文件

GAC中文件的版本"标签

完全陷入困境.有人有想法吗?

推荐答案

首先,验证您的程序集没有被另一个进程锁定 通过gacutil.exe

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

gacutil /u WBRT.Configuration

如果上述操作都可以,请确保文件父容器没有永久性标志- Permanent="no"

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>

这篇关于如何强制从GAC卸载程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆