适用于多台服务器的 GAC 比较工具?
有谁知道有一种工具可以让我生成安装到我的网络场中所有服务器上的 .NET GAC 的程序集的报告吗? (30-40 台服务器)
或者,是否有人有通过 WMI、远程注册表查询或其他技术以编程方式访问信息的某种方式的指针或链接?
Does anyone know of a tool that would allow me to generate a report of the assemblies installed to the .NET GAC on all the servers in my web farm? (30-40 servers)
Or alternatively, does anyone have a pointer or a link on some way of accessing the information programmatically, via WMI, or remote registry query, or some other technology?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢 Kragen,他暗示在 Explorer 的 GAC 视图的表层之下,存在我可以使用 System.IO 命名空间查询的文件。幸运的是我可以通过网络访问每台服务器。
对于单个程序集,我只需要查询许多服务器上的 GAC 中存在的版本。虽然远不是一个完整的报告应用程序,但这个代码片段很好地满足了我的目的:
可以为每个感兴趣的服务器 IP 调用一次,并将 IP、DLL 名称、程序集版本和文件版本打印到控制台。
请随意使用此代码并根据您自己的目的进行修改。
Thanks Kragen, for hinting that beneath the veneer of Explorer's GAC view, there existed files I could query with the System.IO namespace. Luckily I have network access to each server.
I just needed, for a single assembly, to query the versions that existed in the GAC on many servers. While far from a complete reporting application, this snippet served my purposes nicely:
This can be called once for each server IP of interest, and prints the IP, DLL Name, Assembly Version, and FileVersion to the console.
Feel free to take this code and modify for your own purposes.
您可以禁用默认的 GAC 视图,将其变成注册表中的普通资源管理器视图,只需将以下值设置为 1:(
来源 http://sqlmusings.wordpress.com/2007/11/17/how-to-disable-gac-view/)
您然后可以使用一些文件夹比较工具,或者只是从文件夹名称中找出存在哪些程序集。
仅供参考 - 这只是关闭资源管理器视图,但是与文件系统的其他交互点(例如 C# 中的文件对象或命令提示符)已经看到此视图,因此可能不需要在所有文件系统上设置此注册表项你的服务器。
You can disable the default GAC view to turn it into a normal explorer view in the registry, just set the following value to 1:
(Source http://sqlmusings.wordpress.com/2007/11/17/how-to-disable-gac-view/)
You can then just use some folder comparison tool, or just work out what assemblies are present from the folder names.
FYI - this just turns off the explorer view, however other points of interaction with the filesystem (e.g. the File object in C#, or the command prompt) already see this view, so there probably isnt any need to set this registry key on all of your servers.