views:

74

answers:

5

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.

A: 

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);
}
STW
I think this is the best answer, although not what I was hoping for. I didn't want to add code to my project to accomplish this. But looks like it will work.
TheSean
A: 

Check out AppDomain.GetAssemblies

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

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.

GrayWizardx
+1  A: 

Process Explorer?

MK
I think so...or some of the other sysinternals stuff..http://stackoverflow.com/questions/1980429/why-windows-7-isnt-written-in-c
monojohnny
A: 

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.

SoMoS
thanks, wish it was that simple. the way our app is designed is that we have a lot of references loaded at run time. this is what makes it such a pain to figure out. We basically have a bin folder with hundreds of DLLs in it. my project only needs a subset. I *could* just copy all but its way more MBs than I need.
TheSean