HandleProcessCorruptedStateExceptionsAttribute 類別

定義

警告

Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.

啟用 Managed 程式碼,以處理表示處理序損毀狀態的例外狀況。

public ref class HandleProcessCorruptedStateExceptionsAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class HandleProcessCorruptedStateExceptionsAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.Obsolete("Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.", DiagnosticId="SYSLIB0032", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class HandleProcessCorruptedStateExceptionsAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type HandleProcessCorruptedStateExceptionsAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
[<System.Obsolete("Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.", DiagnosticId="SYSLIB0032", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type HandleProcessCorruptedStateExceptionsAttribute = class
    inherit Attribute
Public NotInheritable Class HandleProcessCorruptedStateExceptionsAttribute
Inherits Attribute
繼承
HandleProcessCorruptedStateExceptionsAttribute
屬性

備註

損毀的進程狀態例外狀況是指出進程狀態已損毀的例外狀況。 不建議在此狀態下執行您的應用程式。

根據預設,Common Language Runtime (CLR) 不會將這些例外狀況傳遞給 Managed 程式碼,而且 try/catch 不會為其叫用區塊 (和其他例外狀況處理) 子句。 如果您確定要維護這些例外狀況的處理,您必須將 HandleProcessCorruptedStateExceptionsAttribute 屬性套用至您要執行其例外狀況處理子句的方法。 CLR 只會在具有 HandleProcessCorruptedStateExceptionsAttributeSecurityCriticalAttribute 屬性的方法中,將損毀的進程狀態例外狀況傳遞給適用的例外狀況子句。

您也可以將< legacyCorruptedStateExceptionsPolicy >元素新增至應用程式的組態檔。 這可確保損毀的狀態例外狀況會傳遞至不含 或 SecurityCriticalAttribute 屬性的 HandleProcessCorruptedStateExceptionsAttribute 例外狀況處理常式。 此組態專案不會影響在 .NET Framework 4 之前版本編譯但是在 .NET Framework 4 或更新版本中執行的應用程式;損毀的狀態例外狀況會繼續為這些應用程式傳遞。 HandleProcessCorruptedStateExceptionsAttribute當屬性在部分信任或透明程式碼中遇到時會忽略,因為受信任的主機不應該允許不受信任的增益集攔截並忽略這些嚴重例外狀況。

如需損毀進程狀態例外狀況的詳細資訊,請參閱 CLR Inside Out 部落格中的 處理損毀狀態例外 狀況專案。

僅限 .NET Core: 雖然這個屬性存在於 .NET Core 中,因為不支援從損毀的進程狀態例外狀況復原,所以會忽略這個屬性。 CLR 不會將損毀的進程狀態例外狀況傳遞給 Managed 程式碼。

建構函式

HandleProcessCorruptedStateExceptionsAttribute()
已淘汰.

初始化 HandleProcessCorruptedStateExceptionsAttribute 類別的新執行個體。

屬性

TypeId
已淘汰.

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)

方法

Equals(Object)
已淘汰.

傳回值,這個值指出此執行個體是否與指定的物件相等。

(繼承來源 Attribute)
GetHashCode()
已淘汰.

傳回這個執行個體的雜湊碼。

(繼承來源 Attribute)
GetType()
已淘汰.

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()
已淘汰.

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)
已淘汰.

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()
已淘汰.

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()
已淘汰.

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
已淘汰.

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
已淘汰.

擷取物件的類型資訊,可以用來取得介面的類型資訊。

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)
已淘汰.

擷取物件提供的類型資訊介面數目 (0 或 1)。

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
已淘汰.

提供物件所公開的屬性和方法的存取權。

(繼承來源 Attribute)

適用於