AssemblyLoadContext.EnterContextualReflection 方法

定义

重载

EnterContextualReflection()

CurrentContextualReflectionContext 设置为 thisAssemblyLoadContext

EnterContextualReflection(Assembly)

CurrentContextualReflectionContext 设置为加载了程序集的 AssemblyLoadContext

EnterContextualReflection()

Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
Source:
AssemblyLoadContext.cs
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 的先前值。 它将作为 IDisposableusing 块中使用。

注解

有关详细信息,请参阅 .NET Core 中的 AssemblyLoadContext.CurrentContextualReflectionContext 设计文档

适用于

EnterContextualReflection(Assembly)

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

CurrentContextualReflectionContext 设置为加载了程序集的 AssemblyLoadContext

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 实例的程序集。

返回

一个对象,它用于还原 CurrentContextualReflectionContext 的先前值。 它将作为 IDisposableusing 块中使用。

注解

有关详细信息,请参阅 .NET Core 中的 AssemblyLoadContext.CurrentContextualReflectionContext 设计文档

适用于