RuntimeHelpers.PrepareContractedDelegate(Delegate) 方法

定义

注意

The Constrained Execution Region (CER) feature is not supported.

提供应用程序用来动态准备 AppDomain 事件委托的方法。

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);

参数

d
Delegate

要准备的事件委托。

属性

注解

AppDomain 事件委托(如 DomainUnloadProcessExitUnhandledException )不会在启动时自动准备。 可以使用以下方法来准备它们:

有关详细信息,请参阅 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