.netvisual-studiodebuggingimmediate-window

Visualising lists in debug (or printing to immediate windows)


When I try to see the internal list of Dictionary item I hate to expand every single node one by one. I'm looking for an easier way to do this.

For example:

I've got a Dictionary object Dictionary(Of AnotherObject, Integer) and I want see a property of AnotherObject as a list during the debug.

Normally I'd use this:

For Each item As DictionaryEntry(Of AnotherObject, Integer) in myDict
          Debug.Writeline(item.Name)
Next

But immediate window doesn't support loops.

Is there any practical way to do this in immediate window or debug visualizers?


Solution

  • Have you had a look at VS Visualizers?

    A Generic List and Dictionary Debugger Visualizer for VS.NET

    and

    Write Your Own Visualizer for VS Debugging