Scratching the surface of .net Relflection
September 23 , 2009
Someone asked me if it was possible to find out all the types that a given .net type references. Something similar to Assembly.GetReferencedAssemblies() which returns all assemblies that this assembly uses in turn.
Surprisingly, I did not find anything pre-existing (or maybe I didn't dig deep enough!).
So, I wrote some code to do this using the reflection API.
You can download it from here.
There is no documentation in the code. Will post the details here sometime later.
PS:
1. Note that this is just some random code that I wrote in less than an hour with almost zero testing. If this is what you are looking for, I would recommend you do some serious sanity testing before using it.
2. The code may not satisfy all the scenarios. You may need to add more descriptor methods for additional member types.

