CADability icon indicating copy to clipboard operation
CADability copied to clipboard

Fix Visualizer for Visual Studio >17.6

Open dsn27 opened this issue 1 year ago • 4 comments

Warning CS0618: 'IVisualizerObjectProvider.GetObject()' is obsolete: 'This method uses binary serialization which is no longer supported, please use IVisualizerObjectProvider3.GetObject instead.'

We should take a look at this warning. Would be nice if the Visualizers would work again in the new versions of Visual Studio.

dsn27 avatar Dec 10 '24 19:12 dsn27

I use Rider so I'm not familiar with Visual Studio debugger visualizers and can't test it, but I glanced over the docs and it looks like the main work that needs to be done is switch to the modern VisualizerObjectProvider methods that support JSON and deserialize from that instead. I think most of the classes on that list of warnings already implement IJsonSerialize.

ChrisClems avatar Dec 11 '24 14:12 ChrisClems

Don't bother with this issue if you don't use Visual Studio.

It's only nice to have and not very important.

dsn27 avatar Dec 11 '24 14:12 dsn27

The way DebuggerVisualizer works has changed in Visual Studio 2022 (17.9+).

If we adopt the new approach, it will break compatibility with all previous versions of Visual Studio 2022 (<17.9).

To avoid compatibility issues, I recommend ignoring the remaining compiler warnings related to DebuggerVisualizer for now and rewriting this from scratch in CADability 2.0.

For more details, refer to Microsoft’s documentation: 🔗 New Debugger Visualizer Model

#49

dsn27 avatar Mar 19 '25 13:03 dsn27

Adopting the code for newer versions of VS seems legit. Even if i never missed the visualizer.

stefan-tb avatar Mar 19 '25 13:03 stefan-tb