System.Reflection.Emit.DynamicILInfo.SetCode Method

Sets the code body of the associated dynamic method.

Syntax

[System.CLSCompliant(false)]
public void SetCode (byte* code, int codeSize, int maxStackSize)

Parameters

code
A pointer to a byte array containing the MSIL stream.
codeSize
The number of bytes in the MSIL stream.
maxStackSize
The maximum number of items on the operand stack when the method is executing.

Remarks

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 tp://go.microsoft.com/fwlink/?LinkID=99212 on MSDN and tp://go.microsoft.com/fwlink/?LinkID=65552 on the Ecma International Web site.

Requirements

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