VisualizerObjectSource.Deserialize(Stream) 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.
Caution
This method uses binary serialization which is no longer supported, please use the DeserializeFromJson or GetDeserializableObject methods instead.
Legacy helper method used by old visualizers that makes it easier to write serialization code. It uses default binary serialization to read the given object from the stream. However, due to security vulnerabilities with its usage, it should no longer be used, and will throw on newer versions of .NET like ASP.NET Core 5.0.
If called on a target app that supports Binary Serialization, after the method finishes the stream read pointer is advanced past the bytes of the object
public:
static System::Object ^ Deserialize(System::IO::Stream ^ serializationStream);
public static object Deserialize (System.IO.Stream serializationStream);
[System.Obsolete("This method uses binary serialization which is no longer supported, please use the DeserializeFromJson or GetDeserializableObject methods instead.")]
public static object Deserialize (System.IO.Stream serializationStream);
static member Deserialize : System.IO.Stream -> obj
[<System.Obsolete("This method uses binary serialization which is no longer supported, please use the DeserializeFromJson or GetDeserializableObject methods instead.")>]
static member Deserialize : System.IO.Stream -> obj
Public Shared Function Deserialize (serializationStream As Stream) As Object
Parameters
- serializationStream
- Stream
The stream from which to read the object
Returns
An object which was previously serialized into the stream
- Attributes
Exceptions
Will throw when the target app does not support serialization through BinaryFormatter.
Remarks
This helper method deserializes the data from the stream and uses it to construct a data object. Use this method if you need to create a derived class of VisualizerObjectSource that overrides CreateReplacementObject or TransferData.