April 21st, 2022

View .NET collections with the new IEnumerable Debugger Visualizer

Harshada Hole
Product Manager

While debugging .NET code, inspecting a large and complex collection object can be tedious and difficult. Hence, starting from Visual Studio 17.2. Preview 2, we are introducing a new Visualizer, which will help you view IEnumerable objects such as Arrays, List, etc. in a customized tabular view. 

The IEnumerable visualizer will display collections of objects in a table with a row per object and sortable columns for each field and property. 

IEnumerable Table Visualizer

IEnumerable Visualizer

 

 

Visualize data with IEnumerable Visualizer

The IEnumerable Visualizer is an extension to the existing Dataset Visualizer Dialog Box – Visual Studio (Windows) | Microsoft Docs. You can access this visualizer by clicking on the magnifying glass icon next to the Value in a debugger variables window or in a DataTips. The icon is available for suitable IEnumerable<T> implementations where T can be simple types like List or Arrays or complex types like dictionaries, encapsulated, etc. 

In the case of complex objects where object properties can be another object, the IEnumerable visualizer will show just the immediate object properties. To view all child properties of the object in a table cell, you can use the “Expand Column” option from the column header’s right-click context menu. If you want to focus on specific columns, you can use the “Hide Column” option or the “Hide Children” option to hide all expanded properties. 

IEnumerable Table Visualizer - Columns

Hide/Expand Columns

If the object being visualized has multiple implementations of IEnumerable, the Visualizer will show the first implementation of the object by default. You can use the drop-down on the top to explore members and fields provided by each implementation.

IEnumerable Table Visualizer - Multiple IEnumerable Implementation

 Multiple IEnumerable Implementation

Sorting and Export

The visualizer also supports column sorting in ascending or descending order. Just click on the column title to sort it. 

Finally, if you are interested in exporting the data from the visualizer, you can use the Export button in the top-right corner. It will open the data in Excel (with more options such as exporting to CSV coming in future releases). 

IEnumerable Table Visualizer - Export

Export & Sort

Let us know what you think!

This is the first step toward creating a streaming data visualization experience while debugging. We are constantly working on improving this feature and adding new capabilities in upcoming releases. We appreciate you taking the time to try our latest features and hope you will provide honest feedback by taking this brief survey.

 

 

 

Author

Harshada Hole
Product Manager

Harshada Hole is a Product Manager on the Visual Studio Debugging and Profiling Team, dedicated to enhancing the diagnostics experience by making it more productive and efficient for developers.

24 comments

Discussion is closed. Login to edit/delete existing comments.

  • John Even Pedersen

    This is a great start. 👍👍💪
    I can already start using it, but making it non-modal as mentioned by others will be really useful for debugging.

  • Praveen Potturu

    This visualizer needs to handle dictionaries different from a standard IEnumerable. I hope that is also on the roadmap.

  • Diana Boone

    Will this work with a Blazor WASM client project? When working with our current project, the debugger does not allow you to look at static variables so we have to use console.writeline statement to see the values.

  • Hamza Ouassil

    I tried it the other day, very useful and works like a charm, good job !

  • Hansjoerg Reister · Edited

    😍
    That is one of the most exciting new features I can think of. Will give it a try ASAP. This could get almost as powerful as the .Dump() extension in LinqPad. What about adding charts? 😜

  • FirstSerhii

    Great!)

  • Baker, Brian

    Very cool! Looking forward to trying this out.

  • Gonzalo Fernandez

    Thanks for this great addition!! More tools for debugging will always be welcome! Congrats

  • Josué Rafael Hernández Martínez

    This will have dark theme?

    • Harshada HoleMicrosoft employee Author

      Yes, theming this window is on our roadmap.

  • Vaclav Elias

    Finally, why it took you so long? I found it essential in my debugging. I don’t have to maintain my extension anymore 🤣https://github.com/codecapital/EnumerableVisualizer, maybe you could add search on the top as well?

    Thank you so much!

    • Harshada HoleMicrosoft employee Author

      Thanks a lot for the wonderful extension, hope this new update will be helpful as well.
      Yes, this is just the first version of the visualizer. we have many more enhancements on the roadmap including Search/Filtering.