aberus / ImageVisualizer

A debug visualizer for Visual Studio that allows you to visually view the graphic content of images during debugging.
https://marketplace.visualstudio.com/items?itemName=AleksanderBerus.DebuggerImageVisualizerPreview
MIT License
41 stars 15 forks source link

Throwing NotSupported exception on VS 2022 17.11.1 #20

Open 77 opened 2 weeks ago

77 commented 2 weeks ago

This was working previously but not working on Visual Studio Enterprise 2022 v17.11.1.

An unhandled exception of type 'System.NotSupportedException' was thrown by the custom visualizer component in the process being debugged.

This method is not supported when using the formatter policy 'Legacy'.

at Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource.Serialize(Stream serializationStream, Object target)
   at Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource.GetData(Object target, Stream outgoingData)
   at Aberus.VisualStudio.Debugger.ImageVisualizer.ImageVisualizerBitmapObjectSource.GetData(Object target, Stream outgoingData)
   at Microsoft.VisualStudio.DebuggerVisualizers.DebuggeeSide.Impl.ClrCustomVisualizerDebuggeeHost.GetData(Object visualizedObject)
77 commented 1 week ago

https://learn.microsoft.com/en-us/visualstudio/debugger/walkthrough-writing-a-visualizer-in-csharp?view=vs-2022

Due to the security issues described in Special debugger side considerations for .NET 5.0+, starting with Visual Studio 2022 version 17.11, visualizers won't be able to specify the Legacy formatter policy.