DynamicILInfo.SetExceptions Method

Definition

Sets the exception metadata for the associated dynamic method.

Overloads

SetExceptions(Byte[])

Sets the exception metadata for the associated dynamic method.

SetExceptions(Byte*, Int32)

Sets the exception metadata for the associated dynamic method.

SetExceptions(Byte[])

Source:
DynamicILGenerator.cs
Source:
DynamicILGenerator.cs
Source:
DynamicILGenerator.cs

Sets the exception metadata for the associated dynamic method.

C#
public void SetExceptions(byte[]? exceptions);
C#
public void SetExceptions(byte[] exceptions);

Parameters

exceptions
Byte[]

An array that contains the exception metadata.

Remarks

The exception metadata for a method defines the location and size of all try, catch, finally, filter, and fault blocks. For information on the layout of this metadata, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1

SetExceptions(Byte*, Int32)

Source:
DynamicILGenerator.cs
Source:
DynamicILGenerator.cs
Source:
DynamicILGenerator.cs

Important

This API is not CLS-compliant.

CLS-compliant alternative
System.Reflection.Emit.DynamicILInfo.SetExceptions(Byte[])

Sets the exception metadata for the associated dynamic method.

C#
[System.CLSCompliant(false)]
public void SetExceptions(byte* exceptions, int exceptionsSize);
C#
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public void SetExceptions(byte* exceptions, int exceptionsSize);

Parameters

exceptions
Byte*

A pointer to a byte array containing the exception metadata.

exceptionsSize
Int32

The number of bytes of exception metadata.

Attributes

Exceptions

exceptions is null and exceptionSize is greater than 0.

exceptionSize is less than 0.

Remarks

The exception metadata for a method defines the location and size of all try, catch, finally, filter, and fault blocks. For information on the layout of this metadata, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". For more information, see ECMA 335 Common Language Infrastructure (CLI).

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1