如何通过 PublicKeyToken 从 GAC 中批量卸载程序集?
是否有办法从 GAC 中卸载具有特定 PublicKeyToken 的所有程序集?
我同意命令行(gacutil.exe 等)或通过 C# 的解决方案。
编辑:
仅供参考,我可以通过 Windows 资源管理器执行此操作,然后转到程序集文件夹并按公钥排序,然后他们选择所有有问题的文件,然后右键单击并说卸载。如果这是唯一的方法,那么请确认,否则可以“自动化”的替代方案会很好。谢谢。
Is there anyway to unload all assemblies from the GAC that have a specific PublicKeyToken?
I am okay with the solution being command-line (gacutil.exe, etc) or via C#.
EDIT:
FYI, I can do this via Windows Explorer and going to the assembly folder and sort by public key and they select all the ones in question and right click and say uninstall. If this is the only way then fine please confirm, otherwise alternatives that could be "automated" would be nice. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 GAC API 编写您自己的工具。 此处是该 API 的托管版本。
You could use the GAC API to code your own tool. Here is a managed version of the API.
使用命令行和一点 C# 就很简单:
列出 CSV 行上的所有程序集。
在密钥令牌上过滤此内容并将名称提供给
removelist.txt
With the commandline and a little C# it's easy:
Lists all assemblies on CSV lines.
Filter this on the keytoken and feed the names to a
removelist.txt
for如果您喜欢 Powershell,您可以使用如下内容:
If you like
Powershell
you could use something like this: