Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find all assemblies containing type/member matching a pattern?

I have a folder (possibly, with nested sub-folders) containing thousands of files, some of them are DLLs, and some of those DLLs are .NET assemblies. I need to find all assemblies containing types/members matching a certain pattern (e.g. "*Collection", or "Create*"). What is the best (fastest) way to do this?

It is OK to suggest open-source libraries as long as their usage does not require to open my source code.

like image 868
Liu Jin Tsai Avatar asked May 04 '13 17:05

Liu Jin Tsai


1 Answers

Maybe this api is useful to you: 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.

Or you can load all with Assembly.LoadFrom(path) and call to Assembly.GetExportedTypes()

like image 72
Blau Avatar answered Oct 01 '22 21:10

Blau