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?

- 55,348
- 14
- 97
- 151

- 5,635
- 4
- 25
- 28
-
1Note that `GetAssemblies()` won't work, as it is not recursive and it will miss out any nested assembly references. I've added a recursive version of `GetAssemblies()` at http://stackoverflow.com/questions/383686/how-do-you-loop-through-currently-loaded-assemblies/26300241#26300241. – Contango Oct 10 '14 at 15:58
-
1@Contango: `AppDomain.CurrentDomain.GetAssemblies()` is perfectly fine. It doesn't need to walk references recursively, because it isn't enumerating references in the first place. – Ben Voigt Jul 17 '19 at 19:20
-
Does this answer your question? [How do you loop through currently loaded assemblies?](https://stackoverflow.com/questions/383686/how-do-you-loop-through-currently-loaded-assemblies) – StayOnTarget Feb 03 '20 at 16:26
3 Answers
Using Visual Studio
- Attach a debugger to the process (e.g. start with debugging or Debug > Attach to process)
- While debugging, show the Modules window (Debug > Windows > Modules)
This gives details about each assembly, app domain and has a few options to load symbols (i.e. pdb files that contain debug information).
Using Process Explorer
If you want an external tool you can use the Process Explorer (freeware, published by Microsoft)
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.
Programmatically
Check this SO question that explains how to do it.

- 1
- 1

- 20,615
- 10
- 53
- 74
-
2It's even better than explained here, because in the properties page for a process, Process Explorer shows exactly which AppDomain (including the 'Shared Domain') assemblies are loaded into. So it shows more than just which .dlls are loaded into the process. It would be nice to know what APIs they use to show this (the 'Programmatically' link about will just give the Assemblies in the CurrentDomain). – Govert Feb 09 '12 at 11:21
Here's what I ended up with. It's a listing of all properties and methods, and I listed all parameters for each method. I didn't succeed on getting all of the values.
foreach(System.Reflection.AssemblyName an in System.Reflection.Assembly.GetExecutingAssembly().GetReferencedAssemblies()){
System.Reflection.Assembly asm = System.Reflection.Assembly.Load(an.ToString());
foreach(Type type in asm.GetTypes()){
//PROPERTIES
foreach (System.Reflection.PropertyInfo property in type.GetProperties()){
if (property.CanRead){
Response.Write("<br>" + an.ToString() + "." + type.ToString() + "." + property.Name);
}
}
//METHODS
var methods = type.GetMethods();
foreach (System.Reflection.MethodInfo method in methods){
Response.Write("<br><b>" + an.ToString() + "." + type.ToString() + "." + method.Name + "</b>");
foreach (System.Reflection.ParameterInfo param in method.GetParameters())
{
Response.Write("<br><i>Param=" + param.Name.ToString());
Response.Write("<br> Type=" + param.ParameterType.ToString());
Response.Write("<br> Position=" + param.Position.ToString());
Response.Write("<br> Optional=" + param.IsOptional.ToString() + "</i>");
}
}
}
}
-
btw... I excluded it from the initial post, but I filtered some of the responses like so `foreach(Type type in asm.GetTypes()){ if ((type.ToString().IndexOf("ACLASSIMLOOKINGFOR")>=0) || (type.ToString().IndexOf("BCLASSIMLOOKINGFOR")>=0)){...` – s15199d Nov 30 '11 at 18:02
-
2
-
Instead of using GetExecutingAssembly(), I used GetEntryAssembly() to ensure I'm getting a better list of Assemblies used by my program. If the ExecutingAssembly happens to be a DLL, I'm going to miss out on a few of them. – Harry Glinos Jul 22 '15 at 05:03
-
8try using: Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); – DanW Mar 23 '16 at 16:09
Using the command prompt cmd.exe
you just have to type
tasklist /M
in the console and it will list down all the process with all the dll
loaded by process. If that things went too fast in the console you can copy it to clipboard as
tasklist /M |clip
and paste it to notepad.

- 3,644
- 1
- 27
- 40