System.Reflection.Emit.DynamicMethod.GetILGenerator Method

Returns a Microsoft intermediate language (MSIL) generator for the method with the specified MSIL stream size.

Syntax

public ILGenerator GetILGenerator (int streamSize)

Parameters

streamSize
The size of the MSIL stream, in bytes.

Returns

An System.Reflection.Emit.ILGenerator object for the method, with the specified MSIL stream size.

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