System.Reflection.Emit.ILGenerator Class

Generates Microsoft intermediate language (MSIL) instructions.

See Also: ILGenerator Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComDefaultInterface(typeof(System.Runtime.InteropServices._ILGenerator))]
[System.Runtime.InteropServices.ComVisible(true)]
public class ILGenerator : System.Runtime.InteropServices._ILGenerator

Remarks

System.Reflection.Emit.ILGenerator is used to generate method bodies for methods and constructors in dynamic assemblies (represented by the System.Reflection.Emit.MethodBuilder and System.Reflection.Emit.ConstructorBuilder classes) and for standalone dynamic methods (represented by the System.Reflection.Emit.DynamicMethod class). To obtain an System.Reflection.Emit.ILGenerator, use the ConstructorBuilder.GetILGenerator, DynamicMethod.GetILGenerator, and MethodBuilder.GetILGenerator methods.

MSIL is used as input to a just-in-time (JIT) compiler.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0