.net 如何在 GAC 中列出所有已注册的程序集?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7469405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I list all registered assemblies in GAC?
提问by pencilCake
How can I list all the assemblies that are in the GAC? Do I need a tool that makes it easy to view them?
如何列出 GAC 中的所有程序集?我需要一个可以轻松查看它们的工具吗?
回答by dexter
You can use gacutil provided with Visual Studio for that. Simply open the Developer Command Prompt (available in Start Menu>App>Visual Studio) and run the following command:
为此,您可以使用 Visual Studio 提供的 gacutil。只需打开开发人员命令提示符(在开始菜单>应用程序>Visual Studio 中可用)并运行以下命令:
gacutil -l >yourassemblies.txt
Gacutil is also available as a separate download if you don't have/want Visual Studio.
如果您没有/想要 Visual Studio,也可以单独下载 Gacutil。
回答by Christian.K
If you need the output in text-form, you can use gacutil /l.
如果您需要文本形式的输出,您可以使用gacutil /l.
If you need to get that list from inside, say, an installer or other tool of your own, you might want to look into the APIsto query the GAC.
如果您需要从内部获取该列表,例如,您自己的安装程序或其他工具,您可能需要查看API以查询 GAC。
Also, since originally asked, there are some projects using this API already. Just search the internet for "fusion gac .net". For example this one.
此外,由于最初的要求,已经有一些项目在使用此 API。只需在互联网上搜索“fusion gac .net”。比如这个。
回答by m.edmondson
You can actually navigate to the GAC via explorer or the command line and view the contents of the folder. It's location is C:\Windows\assembly.
您实际上可以通过资源管理器或命令行导航到 GAC 并查看文件夹的内容。它的位置是C:\Windows\assembly。
When viewing via explorer the actual files are hidden and abstracted away, if you need to copy or extract specific versions of the dlls the command line is the way to go.
通过资源管理器查看时,实际文件被隐藏和抽象掉,如果您需要复制或提取特定版本的 dll,则可以使用命令行。
You can also turn off the namespace extension as explained here- which will make explorer act as usual in the GAC.
您还可以按照此处的说明关闭命名空间扩展- 这将使资源管理器在 GAC 中照常运行。

