我可以通过gacutil安装,但不能卸载相同的DLL

我已经使用gacutil安装了一个DLL。

gacutil.exe /i SI.ArchiveService.CommonLogic.Exceptions.dll 

使用gacutil / l表明它确实已安装。

 SI.ArchiveService.CommonLogic.Exceptions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=925c8734ae397609, processorArchitecture=MSIL 

然后我想卸载它。

 gacutil.exe /u SI.ArchiveService.CommonLogic.Exceptions.dll Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved. No assemblies found matching: SI.ArchiveService.CommonLogic.Exceptions.dll Number of assemblies uninstalled = 0 Number of failures = 0 

为什么这不起作用? 我该如何卸载它?

安装程序集需要DLL的路径名 。 卸载需要程序集的显示名称 。 它们不必彼此相似。 查看Assembly.FullName属性。 gacutil.exe /l (列表中的列表)为您提供显示名称列表。

没关系。

 gacutil.exe /u SI.ArchiveService.CommonLogic.Exceptions 

做完了。 还导航到C:\ WINDOWS \ assembly,右键单击它然后选择卸载就可以了。 我通过查看它的属性找出它,名称没有dll扩展名。

如果您在GAC中有多个具有相同显示名称的程序集,则会更安全一些

 gactutil.exe /u myDll,Version=1.1.0.0,Culture=en,PublicKeyToken=874e23ab874e23ab 

在找到答案时来到这里但没有完全得到答案。

你真正需要做的是使用双引号“Assemblyname”围绕完整的程序集名称即

“YOURDLLNAME,Version = 6.3.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”

完成过程,使用命令提示符导航到此路径:C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v8.0A \ bin \ NETFX 4.0工具

并运行查询:gactuil.exe / u“YOURDLLNAME,Version = 6.3.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”

希望这有助于某人