Share via


IAsyncVisualizerObjectProvider Interface

Definition

Provides an async implementation for the methods defined in IVisualizerObjectProvider2 that provide functionality to pass data from the debugee to the visualizer and vice versa.

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

Remarks

The IVisualizerObjectProvider object passed to DialogDebuggerVisualizer's Show(IDialogVisualizerService, IVisualizerObjectProvider) method for VS 17.2 onward is of this type, so you should cast it to use this new functionality.

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)

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)
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)
GetDeserializableObjectAsync(CancellationToken)

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

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)
ReplaceData(Stream)

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

(Inherited from IVisualizerObjectProvider)
ReplaceDataAsync(Stream, CancellationToken)

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

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)
TransferDeserializableObjectAsync(Object, CancellationToken)

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

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)

Applies to