简体   繁体   English

获取应用程序所需的程序集列表

[英]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?有没有办法将 .net 项目的所有必需程序集(不包括 .net 框架)放入准备打包到nsis作为安装文件的文件夹中?

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.我曾尝试编写一个使用反射来获取 dll 列表的小型控制台应用程序,但一直在寻找一种万无一失的方法来确定 dll 是否来自 .net 框架。

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.答案可能是在 Visual Studio 中进行简单的切换以输出所有依赖项,或者可以执行此操作的独立应用程序,或者 Nsis 的插件,或者我遗漏的一些有关反射的信息。

You can use NDepend for this.您可以为此使用NDepend 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.下载它,构建一个新的 NDepend 项目,将您的程序集拖放到应用程序程序集数据网格视图中,您将看到 NDepend 立即解析您的应用程序程序集集所需的层程序集。

You can also provide a list of folders to tell NDepend where to look.您还可以提供一个文件夹列表来告诉 NDepend 去哪里查找。 If a tier assembly can't be found, then NDepend will mark it as not found, which I think is a valuable information.如果找不到层程序集,则 NDepend 会将其标记为未找到,我认为这是一个有价值的信息。

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.在 Visual Studio(至少 2005 - 我现在正在使用的)中,您与项目关联的每个引用都有一个名为“Copy Local”的属性,可以将其设置为 true/false。 When true it will copy the dll's for you into the current configuration directory.当为 true 时,它​​将为您复制 dll 到当前配置目录中。

Dependency Walker is what you need. Dependency Walker正是您所需要的。 Or maybe Depends.Net或者也许取决于.Net

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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