AssemblyLoadContext.EnterContextualReflection Method

Definition

Overloads

EnterContextualReflection()

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
C#
public System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope EnterContextualReflection();

Returns

An object to restore the previous value of CurrentContextualReflectionContext. It is intended to be used as an IDisposable in a using block.

Remarks

For more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

EnterContextualReflection(Assembly)

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs

Sets CurrentContextualReflectionContext to the AssemblyLoadContext which loaded the assembly.

C#
public static System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope EnterContextualReflection(System.Reflection.Assembly? activating);

Parameters

activating
Assembly

The assembly that is used to determine the requested AssemblyLoadContext instance.

Returns

An object to restore the previous value of CurrentContextualReflectionContext. It is intended to be used as an IDisposable in a using block.

Remarks

For more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10