PostSharp uses it. You can download the code at
little difficult to understand the whole flow...
Maybe the following will help:
These methods (ResolveType, ResolveMethod, ...) should be used in the
context of a disassembler or "binary IL reader".
In binary IL code, methods, fields, types and so on are referenced to by
"tokens", i.e. integers. These integers refer to entries in the metadata
A typical use scenario involving ResolveType is:
1. You want to disassemble a method.
2. You get the MethodBase of the method to disassemble. Do the following to
get the generic arguments in the context of this method.
Type typeGenericArguments = method.DeclaringType.GetGenericArguments() ;
Type methodGenericArguments = method.GetGenericArguments();
3. You get a byte array containing the IL code.
4. While reading this byte array, you discover an instruction expecting a
type metadata token (for instance a cast instruction).
5. You want to know what Type refers the token to. Use:
Type type = module.ResolveType( token, typeGenericArguments,
Hope it helped.