我如何列出所有加载的程序集? [英] How do I list all loaded assemblies?

查看:182
本文介绍了我如何列出所有加载的程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.NET中,我想列举所有加载的程序集在所有应用程序域。这样做是为了我的程序的AppDomain中是很容易 AppDomain.CurrentDomain.GetAssemblies()。我是否需要以某种方式访问​​每个应用程序域?或者是有已经执行此工具?

In .Net, I would like to enumerate all loaded assemblies over all AppDomains. Doing it for my program's AppDomain is easy enough AppDomain.CurrentDomain.GetAssemblies(). Do I need to somehow access every AppDomain? Or is there already a tool that does this?

推荐答案

使用Visual Studio

  1. 附加一个调试的过程(例如开始调试或调试>附加到进程)
  2. 在调试时,显示模块窗口(调试>窗口>模块)

这给了每个组件,应用程序域的详细信息,并有几个选项来加载符号(包含调试信息,即pdb文件)。

This gives details about each assembly, app domain and has a few options to load symbols (i.e. pdb files that contain debug information).

输入图像的描述在这里

使用进程管理器

如果你想要一个外部工具,您可以使用的Process Explorer (免费软件,由Microsoft发布)

If you want an external tool you can use the Process Explorer (freeware, published by Microsoft)

点击一个程序,它会显示所有使用的组件列表。该工具是pretty的好,因为它显示了其他信息,如文件句柄等。

Click on a process and it will show a list with all the assemblies used. The tool is pretty good as it shows other information such as file handles etc.

编程

检查<一href="http://stackoverflow.com/questions/383686/how-do-you-loop-through-currenlty-loaded-assemblies">this SO 问题,解释如何做到这一点。

Check this SO question that explains how to do it.

这篇关于我如何列出所有加载的程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆