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

时间:2011-03-25 10:48:40

标签: c# gac gacutil

我使用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

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

4 个答案:

答案 0 :(得分:26)

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

答案 1 :(得分:9)

没关系。

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

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

答案 2 :(得分:3)

如果您在GAC中有多个具有相同显示名称的程序集

,这会更安全一些
gactutil.exe /u myDll,Version=1.1.0.0,Culture=en,PublicKeyToken=874e23ab874e23ab

答案 3 :(得分:0)

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

您实际需要做的是使用围绕完整程序集名称的双引号“Assemblyname”,即

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

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

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

希望这有助于某人

相关问题