ISafeSerializationData 介面

定義

警告

Formatter-based serialization is obsolete and should not be used.

在安全性透明程式碼中啟用自訂例外狀況資料序列化。

public interface class ISafeSerializationData
public interface ISafeSerializationData
[System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public interface ISafeSerializationData
type ISafeSerializationData = interface
[<System.Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId="SYSLIB0050", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type ISafeSerializationData = interface
Public Interface ISafeSerializationData
屬性

備註

在舊版 to.NET Framework 4.0 中,使用 方法完成 GetObjectData 安全性透明程式碼中的自訂使用者資料序列化。 從 .NET Framework 4.0 開始,該方法會標示 SecurityCriticalAttribute 為 屬性,以防止在安全性透明程式碼中執行。 若要解決此問題,請實 ISafeSerializationData 作 介面並新增自訂資料,如下列範例所示。

CompleteDeserialization 序列化之後呼叫 方法,並使用 SafeSerializationEventArgs 還原自訂資料。

方法

CompleteDeserialization(Object)
已淘汰.

還原序列化執行個體時會呼叫這個方法。

適用於

另請參閱