views:

326

answers:

3

Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an nsis as setup file?

I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is from the .net framework or not.

The answer could be a simple switch in Visual Studio to output all dependencies, or a standalone app that can do it, or a plugin for Nsis, or some information on reflection that I've missed.

+1  A: 

In Visual Studio (2005 at least - what I'm using right now), each reference that you have associated to a project has a property called "Copy Local", this can be set to true/false. When true it will copy the dll's for you into the current configuration directory.

DAC
A: 

Dependency Walker is what you need. Or maybe Depends.Net

aku
Dependency Walker does not resolve assembly references (see http://www.dependencywalker.com/faq.html)
Christian.K
+1  A: 

You can use NDepend for this. Download it, build a new NDepend project, drag&drop your assemblies in the Application Assemblies data grid view, and you'll see NDepend resolving instantly the tier assemblies needed by your set of Application Assemblies.

You can also provide a list of folders to tell NDepend where to look. If a tier assembly can't be found, then NDepend will mark it as not found, which I think is a valuable information.

Patrick Smacchia - NDepend dev