microsoft / VSSDK-Extensibility-Samples

Samples for building your own Visual Studio extensions
http://aka.ms/extendvs
MIT License
1.22k stars 452 forks source link

The IAsyncVisualizerObjectProvider.GetDeserializableObjectAsync method is not work. #266

Open aetos382 opened 2 years ago

aetos382 commented 2 years ago

Installed products

Description

The IAsyncVisualizerObjectProvider.GetDeserializableObjectAsync method always returns null.

Steps to recreate

  1. git clone https://github.com/aetos382/SimpleVisualizer.git
  2. cd SimpleVisualizer\SimpleVisualizer.TestConsole
  3. dotnet run

Current behavior

An exception message is displayed in the visualizer window.

Expected behavior

The visualizer window will display "Hello".

Notes

Open SimpleVisualizer.DebuggerSide/Visualizer.cs, rewrite it to UseAsyncProvider = false and run again, it will work as expected. In this case, the IVisualizerObjectProvider.GetObject method is used instead of the IAsyncVisualizerObjectProvider.GetDeserializableObjectAsync method.

Inside the implementation of the IAsyncVisualizerObjectProvider.GetDeserializableObjectAsync method, it tries to get the object from another AppDomain, but the SerializationException was thrown because CancellationToken passed as an argument of the method is not serializable, and the method returns null.