Search code examples
.netdeploymentsysinternals

How can I get a list of files loaded by my process?


I'm trying to do a quick and dirty deployment of a project. I thought it would be easy to run my process, use some tool to grab a list of all loaded files (DLLs) and use that list to create a copy file list for my test deployment.

Thought about using filemon but there is a lot of noise in there. Its a .net project.

Thanks.


Solution

  • You should be able to use .NET's Reflection to analyze your application AppDomain(s) and dump a list of loaded assemblies and locations.

    var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
    foreach (var assembly in loadedAssemblies)
    {
        Console.WriteLine(assembly.GetName().Name);
        Console.WriteLine(assembly.Location);
    }