开发者

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 cre开发者_如何学Goate 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.


Process Explorer?


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);
}


Check out AppDomain.GetAssemblies

For Each Ass As Reflection.Assembly In CurrentDomain.GetAssemblies()
    Console.WriteLine(Ass.ToString())
Next


This is answered in another question already.

The gist of it is use current appdomain to get a list of assemblies and loop through their loader location.


If I have understood your question, to do a fast deployment you can set in all the references of your project but the Framework ones the setting "Copy Local" to true.

This way when you build your application you will have all the needed DLLs at your output directory (well, almost all, references needed by your references won't be copied automatically, so it's best to add them as a local reference too).

Hope this helps. If not, just say why, I will try to continue on this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜