简体   繁体   中英

Getting a list of assemblies needed by application

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.

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM