Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ConstructorBuilder.GetILGenerator Method (Int32)

Returns a Microsoft intermediate language (MSIL) generator, with the specified MSIL stream size, that can be used to build a method body for this constructor.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)
public ILGenerator GetILGenerator(
	int streamSize
)

Parameters

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

Return Value

Type: System.Reflection.Emit.ILGenerator
An MSIL generator that can be used to emit a method body for this constructor.
ExceptionCondition
InvalidOperationException

The constructor is a default constructor that was created by using the TypeBuilder.DefineDefaultConstructor method.

-or-

The constructor has MethodAttributes or MethodImplAttributes flags indicating that it should not have a method body.

The runtime generates the code for default (parameterless) constructors that are created by using the TypeBuilder.DefineDefaultConstructor method. An exception is thrown if you try to obtain an ILGenerator for such a constructor.

Silverlight

Supported in: 5, 4, 3

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.