Condividi tramite


MethodBuilder.GetILGenerator Method (Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns an ILGenerator for this method with the specified Microsoft intermediate language (MSIL) stream size.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Function GetILGenerator ( _
    size As Integer _
) As ILGenerator
public ILGenerator GetILGenerator(
    int size
)

Parameters

  • size
    Type: System.Int32
    The size of the MSIL stream, in bytes.

Return Value

Type: System.Reflection.Emit.ILGenerator
An ILGenerator object for this method.

Exceptions

Exception Condition
InvalidOperationException

The method should not have a body because of its MethodAttributes or MethodImplAttributes flags, for example because it has the MethodAttributes.PinvokeImpl flag.

-or-

The method is a generic method, but not a generic method definition. That is, the IsGenericMethod property is true, but the IsGenericMethodDefinition property is false.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.