System.Reflection.Emit.DynamicMethod.GetILGenerator Method

Returns a Microsoft intermediate language (MSIL) generator for the method with a default MSIL stream size of 64 bytes.

Syntax

public ILGenerator GetILGenerator ()

Returns

An System.Reflection.Emit.ILGenerator object for the method.

Remarks

After a dynamic method has been completed, by calling the erload:System.Reflection.Emit.DynamicMethod.CreateDelegate or erload:System.Reflection.Emit.DynamicMethod.Invoke method, any further attempt to add MSIL is ignored. No exception is thrown.

Note:

There are restrictions on unverifiable code in dynamic methods, even in some full-trust scenarios. See the "Verification" section in Remarks for System.Reflection.Emit.DynamicMethod.

Requirements

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