c# - 如何找到所有包含匹配模式的类型/成员的程序集?

标签 c# .net reflection assemblies clr

我有一个包含数千个文件的文件夹(可能包含嵌套的子文件夹),其中一些是 DLL,而其中一些 DLL 是 .NET 程序集。我需要找到所有包含与特定模式匹配的类型/成员的程序集(例如 "*Collection""Create*")。最好(最快)的方法是什么?

只要使用不需要打开我的源代码,就可以推荐开源库。

最佳答案

也许这个 api 对你有用:http://cciast.codeplex.com/

Microsoft Research Common Compiler Infrastructure (CCI) is a set of libraries and an application programming interface (API) that supports some of the functionality that is common to compilers and related programming tools. CCI is used primarily by applications that create, modify or analyze .NET portable executable (PE) and debug (PDB) files.

或者您可以使用 Assembly.LoadFrom(path) 加载所有内容并调用 Assembly.GetExportedTypes()

关于c# - 如何找到所有包含匹配模式的类型/成员的程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16377235/

相关文章:

c# - 将 XML 发布到 URL

c# - 比较版本标识符

java - android :onClick use Java reflection concepts behind the scenes?吗

c# - If 语句在类型转换后不起作用

c# - 如何使用 C# 连接到 MySQL 并在控制台中显示条目列表?

c# - LinkedIn V2 API 权限似乎不起作用

c# - 安装 OpenXML 文件转换器

java - 访问Java类上的私有(private)类

c# - HttpWebRequest.Begin GetRequestStream() 最佳实践

c# - 如何在新创建的 .NET Core 2.0 Web 应用程序中以 .NET Standard 2.0 为目标?