19

When debugging in Visual Studio 2010 and hovering over a variable name, I'm given the option to use 3 different built-in visualizers: Text, XML, & HTML.

Here is an example of what I'm referring to:

Visual studio debugger visualization screenshot

Since I'm doing more and more work with JSON based data, is there a JSON visualizer that I can install?

Dan Esparza
  • 28,047
  • 29
  • 99
  • 127

5 Answers5

13

Yes, use this addon on Codeplex.

archive.org - JSON Viewer on Codeplex

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Paul Mendoza
  • 5,709
  • 12
  • 53
  • 82
  • 1
    No - it produces 'System.IO.FileNotFoundException' when you click a variable and choose JSON as the visualizer. I'm using the latest version which is 1.2. – Ofer Zelig Jan 10 '12 at 09:58
  • i cant find JsonViewer.dll.config – PUG Mar 10 '14 at 19:44
  • System.InvalidCastException: Unable to cast object of type 'EPocalipse.Json.Visualizer.JsonVisualizer' to type 'Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer'. at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy) – Greg Woods Aug 30 '16 at 12:03
6

Overtly visible disclamer: I wrote this and I'm giving it away for free via Microsofts Visual Studio Gallery. No ads, no link to my own site or anything.

I found this thread when looking for the exact same thing but seeing that http://jsonviewer.codeplex.com/ is "A visualizer for Visual Studio 2005" i felt that it was probably to outdated for my use. So I wrote a new visualizer instead (with built in jsonlint-support!). It has been tested with Visual Studio 2012 (but probably works fine for at least 2008 and 2010) and available from Microsofts Visual Studio Gallery.

Karl-Johan Sjögren
  • 16,544
  • 7
  • 59
  • 68
  • can it convert a object into json string? – PUG Mar 10 '14 at 19:57
  • No, this is just a tool to preview JSON in string variables in Visual Studio. If you need to work with JSON in your own project (serializing/deserializing objects for example) you should have a look at JSON.Net. http://james.newtonking.com/json – Karl-Johan Sjögren Mar 10 '14 at 20:56
  • It seems so, that site hasn't been up in a few months. I kinda abandoned this addon since it came builtin in Visual Studio 2015 (even the community edition). Nevertheless, I've uploaded the latest version I found on my computer (which was newer then the one available earlier) so hopefully it'll work if you are on an older version of visual studio. – Karl-Johan Sjögren Aug 30 '16 at 13:58
4

You may reference theses posts:

JSON Debugger visualizer in Visual Studio 2012

JSON Debugger Visualizer in Visual Studio 2013

Megadotnet
  • 309
  • 2
  • 6
3

Actually it does work in visual studio 2010, but you have to unblock the assemblies. In explorer right click on the DLL and view properties the is a button to unblock the assembly.

dave
  • 31
  • 1
3

I know the question references specifically Visual Studio 2010, but at least in Visual Studio 2019, the JSON Visualizer is already integrated so you don't need any extension, I would say.

Just select the JSON Visualizer in variable's view context menu:

select JSON Visualizer

And then press the view button:

view a variable containing a JSON string

David Ferenczy Rogožan
  • 23,966
  • 9
  • 79
  • 68