AssemblyLoadContext.EnterContextualReflection 方法

定义

重载

EnterContextualReflection()

CurrentContextualReflectionContext 设置为 thisAssemblyLoadContextSets CurrentContextualReflectionContext to thisAssemblyLoadContext.

EnterContextualReflection(Assembly)

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

EnterContextualReflection()

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

返回

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 design doc in .Net CoreFor more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

适用于

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

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

返回

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 design doc in .Net CoreFor more information, see AssemblyLoadContext.CurrentContextualReflectionContext design doc in .NET Core.

适用于