Dump any object to JSON from the Visual Studio Debugger

Опубликовано: 11 Июль 2026
на канале: Richard Moore - Engineering at Home
1,613
15

Here's a handy trick for you, how to dump any object in Visual Studio to a JSON file using the Visual Studio debugger.

This way you can take a snapshot of the state of a complex object as JSON and paste it into a text editor such as Notepad++ to browse at your leisure.

Or take two snapshots as JSON at different times and easily compare them using a text comparison tool like WinMerge.

You could even take a JSON snapshot of an object, save it as a JSON file and then load it back into your application as part of a unit test.