I want to analyze assemblies using reflection.
Specifically, I want to find out if a certain interface is implemented in a type in the assembly.
Not all references of the assembly are present on the machine though, which is why I need to analyze them.
So when I call GetTypes or GetExportedTypes, a FileNotFoundException is thrown, telling me that a “referenced assembly cannot be loaded”.
This is true, but still I want to know what types are implemented in this assembly.
Reflector can do it somehow. How can this be done?
EDIT: I just found out about Mono.Cecil, does exactly what I want in an easy way. However, it is an external library and no built-in solution.
CCI might be kinda heavyweight for what you want, but it can reflect over assemblies without having them all loaded: http://cciast.codeplex.com/