AssemblyLoadContext.EnterContextualReflection AssemblyLoadContext.EnterContextualReflection AssemblyLoadContext.EnterContextualReflection AssemblyLoadContext.EnterContextualReflection Method

定义

重载

EnterContextualReflection() EnterContextualReflection() EnterContextualReflection() EnterContextualReflection()

CurrentContextualReflectionContext 设置为 thisAssemblyLoadContextSets CurrentContextualReflectionContext to thisAssemblyLoadContext.

EnterContextualReflection(Assembly) EnterContextualReflection(Assembly) EnterContextualReflection(Assembly) EnterContextualReflection(Assembly)

CurrentContextualReflectionContext 设置为加载了程序集的 AssemblyLoadContextSets CurrentContextualReflectionContext to the AssemblyLoadContext which loaded the assembly.

EnterContextualReflection() EnterContextualReflection() EnterContextualReflection() EnterContextualReflection()

CurrentContextualReflectionContext 设置为 thisAssemblyLoadContextSets CurrentContextualReflectionContext to thisAssemblyLoadContext.

public:
 System::Runtime::Loader::AssemblyLoadContext::ContextualReflectionScope EnterContextualReflection();
public System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope EnterContextualReflection ();
member this.EnterContextualReflection : unit -> System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope
Public Function EnterContextualReflection () As AssemblyLoadContext.ContextualReflectionScope

返回

一个对象,它用于还原 CurrentContextualReflectionContext 的先前值。An object to restore the previous value of CurrentContextualReflectionContext. 它将作为 IDisposableusing 块中使用。It is intended to be used as an IDisposable in a using block.

注解

有关详细信息,请参阅AssemblyLoadContext.CurrentContextualReflectionContext.NET Core 中的设计文档For more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

EnterContextualReflection(Assembly) EnterContextualReflection(Assembly) EnterContextualReflection(Assembly) EnterContextualReflection(Assembly)

CurrentContextualReflectionContext 设置为加载了程序集的 AssemblyLoadContextSets CurrentContextualReflectionContext to the AssemblyLoadContext which loaded the assembly.

public:
 static System::Runtime::Loader::AssemblyLoadContext::ContextualReflectionScope EnterContextualReflection(System::Reflection::Assembly ^ activating);
public static System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope EnterContextualReflection (System.Reflection.Assembly activating);
static member EnterContextualReflection : System.Reflection.Assembly -> System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope
Public Shared Function EnterContextualReflection (activating As Assembly) As AssemblyLoadContext.ContextualReflectionScope

参数

activating
Assembly Assembly Assembly Assembly

用于确定请求的 AssemblyLoadContext 实例的程序集。The assembly that is used to determine the requested AssemblyLoadContext instance.

返回

一个对象,它用于还原 CurrentContextualReflectionContext 的先前值。An object to restore the previous value of CurrentContextualReflectionContext. 它将作为 IDisposableusing 块中使用。It is intended to be used as an IDisposable in a using block.

注解

有关详细信息,请参阅AssemblyLoadContext.CurrentContextualReflectionContext.NET Core 中的设计文档For more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

适用于