Visualising lists in debug (or printing to immediate windows)
-
22-09-2019 - |
Question
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
OTHER TIPS
While you can't use loops in the immediate window, it does allow you to declare new variables, so you can create new lists etc. which can then be displayed in the watch window.