This section describes a set of managed types in the System.Reflection.Emit namespace that enable your application to emit metadata and Microsoft intermediate language (MSIL) at run time. Script engines and compilers are the primary users of this namespace. In this section, the functionality provided by the System.Reflection.Emit namespace is referred to as reflection emit.
Reflection emit provides the following capabilities:
Defines lightweight global methods at run time, using the DynamicMethod class, and executes them using delegates.
Generates assemblies at run time.
Defines types in modules at run time, creates instances of these types, and invokes their methods.
A useful resource for working with metadata and MSIL is the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". The documentation is available online at the ECMA C# and Common Language Infrastructure Standards page on MSDN and on the Ecma International Web site.
Lists and describes the reflection emit classes you can use to define assemblies and types, methods and method parameters, events, constructors, properties, and so forth.
Explains how to create dynamic assemblies, modules, and types; how to add members to types; how to emit MSIL for methods and constructors; and how to add program logic and exception handling.
Describes the class that represents types in reflection, and that is the base class of TypeBuilder, which represents dynamic types in reflection emit. This class is key to the use of these technologies.