RuntimeHelpers.PrepareContractedDelegate(Delegate) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
The Constrained Execution Region (CER) feature is not supported.
提供应用程序用来动态准备 AppDomain 事件委托的方法。
public:
static void PrepareContractedDelegate(Delegate ^ d);
C#
[System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareContractedDelegate(Delegate d);
C#
public static void PrepareContractedDelegate(Delegate d);
C#
[System.Security.SecurityCritical]
public static void PrepareContractedDelegate(Delegate d);
[<System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member PrepareContractedDelegate : Delegate -> unit
static member PrepareContractedDelegate : Delegate -> unit
[<System.Security.SecurityCritical>]
static member PrepareContractedDelegate : Delegate -> unit
Public Shared Sub PrepareContractedDelegate (d As Delegate)
- d
- Delegate
要准备的事件委托。
- 属性
AppDomain 事件委托(如 DomainUnload、 ProcessExit和 UnhandledException )不会在启动时自动准备。 可以使用以下方法来准备它们:
使用 特性对 PrePrepareMethodAttribute 方法进行特性化。
使用 特性对 ReliabilityContractAttribute 方法进行特性化。
PrepareContractedDelegate调用 方法以动态准备委托。
有关详细信息,请参阅 MSDN 杂志中的文章使用.NET Framework的可靠性功能使代码保持运行。
产品 | 版本 (已过时) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1 (5, 6, 7, 8, 9) |
.NET Framework | 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.0, 2.1 |