<p>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 <a href="http://nsis.sourceforge.net/Main_Page" rel="nofollow noreferrer">nsis</a> as setup file?</p>

<p>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.</p>

<p>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.</p>

[{'answer_id': 52042, 'author': 'DAC', 'author_id': 1111, 'author_profile': 'https://Stackoverflow.com/users/1111', 'pm_score': 2, 'selected': True, 'text': '<p>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.</p>\n'}, {'answer_id': 52052, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.dependencywalker.com" rel="nofollow noreferrer">Dependency Walker</a> is what you need. Or maybe <a href="http://www.netomatix.com/Development/DependsNet.aspx" rel="nofollow noreferrer">Depends.Net</a></p>\n'}, {'answer_id': 308269, 'author': 'Patrick from NDepend team', 'author_id': 27194, 'author_profile': 'https://Stackoverflow.com/users/27194', 'pm_score': 1, 'selected': False, 'text': '<p>You can use <a href="http://www.NDepend.com" rel="nofollow noreferrer">NDepend</a> for this. Download it, build a new NDepend project, drag&amp;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. </p>\n\n<p>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.</p>\n'}]
['https://Stackoverflow.com/questions/52022', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4002/']