RuntimeHelpers.PrepareContractedDelegate(Delegate) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
The Constrained Execution Region (CER) feature is not supported.
为应用程序提供动态准备 AppDomain 事件委托的方法。
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}")]
public static void PrepareContractedDelegate(Delegate d);
public static void PrepareContractedDelegate(Delegate d);
[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,ProcessExitUnhandledException在启动时不会自动准备。 可以使用以下方法来准备它们:
使用特性对方法进行 PrePrepareMethodAttribute 属性属性。
使用特性对方法进行 ReliabilityContractAttribute 属性属性。
PrepareContractedDelegate调用该方法以动态准备委托。
有关详细信息,请参阅 MSDN 杂志中 .NET Framework 的可靠性功能使代码保持运行 的文章。