Writing

Mono.Cecil

Reading, generating, and rewriting .NET assemblies with Mono.Cecil.

  1. Mono.Cecil: SimplifyMacros and OptimizeMacros

    What SimplifyMacros and OptimizeMacros do in Mono.Cecil, and why rewriting a method should start with one and end with the other.

  2. Mono.Cecil: Generics

    Importing and instantiating a generic type with Mono.Cecil, and why the method reference’s declaring type must be the generic instance.

  3. Mono.Cecil: IAssemblyResolver

    What IAssemblyResolver does in Mono.Cecil, and why real projects should give the reader one shared, custom resolver.

  4. Mono.Cecil: Nothing stops you (well, almost)

    Mono.Cecil follows the CLI rules rather than the C# rules, so it can do things C# forbids, such as giving a method a name that is illegal in C#.

  5. Mono.Cecil: Hello, World

    A minimal Mono.Cecil program that creates an assembly from scratch, with one type and a method that prints Hello World.

  6. Mono.Cecil: An overview

    An introduction to Mono.Cecil: what it offers over Reflection.Emit, the difference between references and definitions, and the core types of its object model.