DynamicILInfo.SetCode Method (Byte[], Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sets the code body of the associated dynamic method.

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

public void SetCode(
	byte[] code,
	int maxStackSize


Type: System.Byte[]

An array that contains the MSIL stream.

Type: System.Int32

The maximum number of items on the operand stack when the method is executing.

No validity checks are performed on the MSIL stream.

Calling this method a second time replaces the first MSIL stream with the second.

Generating your own metadata and MSIL requires familiarity with the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". The documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.

.NET Framework
Available since 2.0
Return to top