ImageVisualizer icon indicating copy to clipboard operation
ImageVisualizer copied to clipboard

Throwing NotSupported exception on VS 2022 17.11.1

Open 77 opened this issue 1 year ago • 8 comments

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 avatar Aug 25 '24 19:08 77

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.

77 avatar Sep 02 '24 17:09 77

Hey 77, have you found a workaround for the problem?

nikefa avatar Sep 27 '24 05:09 nikefa

Unfortunately, I ended up using another Debug Image Viewer. Not sure if it is bad taste to put the name here or not?

Joe-Fernico avatar Sep 27 '24 07:09 Joe-Fernico

I would be very grateful for the name^^ Currently I save the Bitmaps to view them

nikefa avatar Sep 27 '24 07:09 nikefa

https://marketplace.visualstudio.com/items?itemName=KGySoft.drawing-debugger-visualizers

Joe-Fernico avatar Sep 27 '24 07:09 Joe-Fernico

https://marketplace.visualstudio.com/items?itemName=KGySoft.drawing-debugger-visualizers

Same isssue ?

binbon2d avatar Sep 29 '24 14:09 binbon2d

Here is a quick fix (It may or may not work 🚧), can you try and give a feedback if it solves this issue: SetupVisualizer.zip

aberus avatar Nov 11 '24 21:11 aberus

New version released with a fix.

aberus avatar Nov 19 '24 22:11 aberus