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)
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.
This was working previously but not working on Visual Studio Enterprise 2022 v17.11.1.