什么工具(或工具链)将生成 .NET 程序集所需的 DLL 的完整列表?
问题:假设您有一台机器,某些 .NET 程序集在其上正确注册、加载和/或运行。该程序集可以通过 p/invoke 引用非托管 DLL,它可以利用 COM 对象,并且实际上可以在 C++/CLI 中实现。如何在一个自动化步骤中生成必须安装的所有其他 DLL(托管和非托管)的列表,以便它也可以在另一台计算机上注册、加载和/或运行?
部分解决方案#1:Red-gate 的 .net Reflector 可用于识别所有托管参考。
部分解决方案#2:Red-gate 的 .net Reflector 具有“分析”功能它将识别通过 p/invoke 使用的非托管 DLL
部分解决方案 #3:Depends 可以识别以下非托管 DLL由 EXE 或 DLL 导入。 (并且在其分析模式下,还可以识别动态依赖关系)。
打开:如何以批处理模式运行这些工具(或其他工具),而不是手动单击所有依赖链?
附加问题:COM 引用怎么样——有没有办法识别所需的 COM 对象,然后跟踪它们的依赖关系?
相关问题:我看到这个问题涵盖了类似的基础。 (但它没有指定也可以找到非托管依赖项,并且接受的答案是 .net Reflector,它仅提供我正在寻找的部分内容。)类似于 这个。
Problem: Assume you have a machine on which some .NET assembly registers, loads, and/or runs correctly. This assembly may reference unmanaged DLLs via p/invoke, it may utilize COM objects, and it may actually be implemented in C++/CLI. How can you produce, in one automated step, a list of all the other DLLs (managed and unmanaged) that must be installed so that it will also register, load, and/or run on another machine?
Partial Solution #1: Red-gate's .net reflector can be used identify all the managed references.
Partial Solution #2: Red-gate's .net reflector has an "analyze" feature that will identify unmanaged DLLs utilized via p/invoke
Partial Solution #3: Depends can identify the unmanaged DLLs that are imported by an EXE or DLL. (And in its profiling mode, can also identify dynamic dependencies).
Open: How to run these tools (or others) in a batch mode, rather than manually clicking through all the dependency chains?
Bonus question: What about COM references -- is there any way to identify required COM objects and then also trace their dependencies?
Related Questions: I see that this question covers similar ground. (But it does not specify that unmanaged dependencies also be found, and the accepted answer is .net reflector which only provides part of what I'm looking for.) Similar for this one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你根本不能,至少不能以一种值得信赖的方式。安装包允许放置文件、注册表项以及在安装时执行的其他操作。
除非项目XCOPY 部署,否则几乎不可能弄清楚并保证新项目需要什么从已安装的内容中正确安装。
You simply cannot, at least not in a trustworthy manner. Install packages allow for things like placement of files, registry entries, and other actions to be performed on install.
Unless the project was XCOPY deployed, it's virutally impossible to figure out and guarantee what is required for a new proper install from what has been installed.