February 24th, 2009
Sometimes it is handy to have a quick overview of all the assemblies that your C# program has loaded. Maybe because you are trying to debug a version conflict, or because you want to distribute your application and want to get an idea of its dependencies.
Read the rest of this entry »
Tags: c#, reflection
Posted in Intermediate, Learn C# | 3 Comments - getting there! »
February 17th, 2009

In this post I look at how we can simply retrieve basic information about our own types, discover their methods and lastly how we can import a foreign assembly, inspect its contents, load a class and execute its methods.
When C# compiles your code it not only stores the program in the assembly but the complete information on each of the structures you have defined. Each class, its types, parameters and methods described into detail are all available. This might sound like stating the obvious, but until recently most compilers treated this kind of “meta” data as a waste of space and never included it into the final assembly.
Read the rest of this entry »
Tags: c#, reflection
Posted in Chapter | 1 Comment already!»