如何获取应用程序使用的DLL的名称 [英] How to get Names of DLLs used by application

查看:76
本文介绍了如何获取应用程序使用的DLL的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种读取应用程序使用的所有程序集(.dll)的方法。



在一个标准的C#项目中,有一个参考文件夹,展开后,我可以读取所有使用的库。



我的目标是以编程方式读取解决方案中每个项目使用的所有程序集。



最后,我是d想看看我已编译的* .exe应用程序使用了哪些库。

解决方案

您是否看过 Assembly.GetReferencedAssemblies



请注意,您不使用的任何引用都不会最终发送到元数据中,因此在执行时不会看到它们。 / p>

我以前递归地使用了 GetReferencedAssemblies 来查找命名类型,而不必指定程序集。


I'm looking the way to read all assemblies (.dlls) used by my app.

In a standard C# project there is "References" folder, when it is expanded I can read all libraries used.

My goal is programatically read all assemblies which are used by each project in my solution.

Finally I'd like to see what libraries are used by my compiled *.exe application.

解决方案

Have you looked at Assembly.GetReferencedAssemblies?

Note that any references you don't use won't end up being emitted into the metadata, so you won't see them at execution time.

I've used GetReferencedAssemblies recursively before now to find a named type without having to specify the assembly.

这篇关于如何获取应用程序使用的DLL的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆