ExceptionSettings.CanDeserialize(Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tests whether a type can be deserialized as part of deserializing an exception.
public abstract bool CanDeserialize(Type type);
abstract member CanDeserialize : Type -> bool
Public MustOverride Function CanDeserialize (type As Type) As Boolean
Parameters
- type
- Type
The type that may be deserialized.
Returns
true
if the type is safe to deserialize; false
otherwise.
Remarks
The default implementation returns true
for all types in TrustedData-based instances; or for UntrustedData-based instances will return true
for Exception-derived types that are expected to be safe to deserialize.
Exception-derived types that may deserialize data that would be unsafe coming from an untrusted party should consider the StreamingContext passed to their deserializing constructor and skip deserializing of potentitally dangerous data when State includes the Remoting flag.