Share via


IVisualizerObjectProvider3 Interface

Definition

Lets visualizer debugger and debuggee side components coordinate on which serialization mechanism to use, and provides additional functionality to pass data to the debuggee-side taking into account the SelectedFormatterPolicy.

public interface IVisualizerObjectProvider3 : Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider2
type IVisualizerObjectProvider3 = interface
    interface IVisualizerObjectProvider2
    interface IVisualizerObjectProvider
Public Interface IVisualizerObjectProvider3
Implements IVisualizerObjectProvider2
Implements

Properties

IsBinaryFormatterSupported

Specifies if the debuggee supports the BinaryFormatter since it was deprecated in .NET 5. If it does not, the provider most use JSON to communicate with the visualizer.

(Inherited from IVisualizerObjectProvider)
IsObjectReplaceable

Specifies whether a replacement object can be created. That is, determines whether the data object being visualized is replaceable (read/write) or nonreplaceable (read only).

(Inherited from IVisualizerObjectProvider)
SelectedFormatterPolicy

The format policy that this class will use when serializing/deserializing information.

Methods

Deserialize(Stream)
Obsolete.

Legacy helper method used by old visualizers that makes it easier to write deserialization 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 is read and we return the underlying object.

(Inherited from IVisualizerObjectProvider2)
DeserializeFromJson<T>(Stream, Object)

Deserializes the data in Newtonsoft.Json format from the specified stream into an object of a specific type.

GetData()

Gets an initial blob of data about the object being debugged. The data is written into the provided MemoryStream.

(Inherited from IVisualizerObjectProvider)
GetDeserializableObject()

Gets the data using GetData and then returns an IDeserializableObject so that the caller can deserialize with JSON if default seriallization is not supported.

(Inherited from IVisualizerObjectProvider2)
GetDeserializableObjectFrom(Stream)

Helper method that can be used to get a deserializable object for cases in which the target app might not support Binary Serialization. In these cases the underlying format should be serialized using JSON, so callers can query individual properties to determine the type of the object they want to deserialize.

(Inherited from IVisualizerObjectProvider2)
GetObject()
Obsolete.

Gets the data using GetData and then deserializes assuming that default serialization has been done

(Inherited from IVisualizerObjectProvider)
GetObject<T>()

Gets the data using GetData() and then tries to deserialize it to the specified type.

ReplaceData(Stream)

Creates a replacement copy of the object based on the serialized data given.

(Inherited from IVisualizerObjectProvider)
ReplaceObject(Object)

Serializes the object using default serialization and then sets the data using ReplaceData

(Inherited from IVisualizerObjectProvider)
Serialize(Object, Stream)

Helper method which makes it easier to write serialization code.

If the target app supports Binary Serialization it serializes the object into the stream with the help of the BinaryFormatter class. If that is not supported, which is the case in newer versions of .NET, it defaults to serialize the object in JSON format.

(Inherited from IVisualizerObjectProvider2)
TransferData(Stream)

Transfers the data bidirectionally to the TransferData method on the VisualizerObjectSource

(Inherited from IVisualizerObjectProvider)
TransferDeserializableObject(Object)

Serializes the outgoing object using as an IDeserializableObject and then calls TransferData. Upon return deserializes the incoming data and returns the object wrapped in an IDeserializableObject.

(Inherited from IVisualizerObjectProvider2)
TransferObject(Object)
Obsolete.

Serializes the outgoing object using default serialization and then calls TransferData. Upon return deserializes the incoming data and returns the deserialized object

(Inherited from IVisualizerObjectProvider)
TransferObject<T>(Object)

Serializes the outgoing object using the SelectedFormatterPolicy and then calls TransferData(Stream). Upon return it tries to deserialize the incoming data and returns the object of the specified type.

Applies to