如何强制从 GAC 卸载程序集?

发布于 2024-12-26 14:29:32 字数 1264 浏览 5 评论 0原文

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

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

使用 /l*v 开关,不会出现错误:

Executing op: ActionStart(Name=MsiUnpublishAssemblies,Description=Unpublishing assembly information,Template=Application Context:[1], Assembly Name:[2]) 执行操作: AssemblyUnpublish(,,AssemblyType=1,,AssemblyName=WBRT.Configuration,版本=“1.0.0.0”,culture=“中性”,publicKeyToken=“361AD75BADC53912”,processorArchitecture=“MSIL”,Descriptor=2-(xWui~z@ UnhQuo-~Gh>S.OwM9Kim9x0ul%Ore=9) 执行操作:ActionStart(Name=UnpublishFeatures,Description=取消发布产品功能,Template=功能:[1])

WiX File element

Orca 中的 MsiAssemblyName 表

MSIAssemblyName

GAC 中的文件

GAC 中的文件

GAC 中文件的版本选项卡

版本

I'我完全被难住了。有人有想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹎☆浅夏丿初晴 2025-01-02 14:29:32

我按照 @Mohsen 提到的步骤操作,删除注册表项并从 GAC 卸载 DLL 以解决冲突问题。

[HKLM\SOFTWARE\Classes\Installer\Assemblies\Global] 并运行 gacutil /u dllname - 并成功。
我不知道有什么副作用。它对我有用,然后我运行了

gacutil -u dllThatIWantedToRemove

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

淡淡離愁欲言轉身 2025-01-02 14:29:32

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

gacutil /u WBRT.Configuration

如果上述内容正常,请确保文件父容器没有永久标志 -
永久=“否”

<Component Shared="yes" Permanent="no" Guid="PUT-GUID-HERE" >
    <File Id="filB7155C3E9A241BEAFE09533364964732" KeyPath="yes" Assembly=".net" 
       Source="$(var.Configuration.TargetDir)\WBRT.Configuration.dll" />
</Component>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文