Said's Blog

Visual Studio - IEnumerable Debugger Visualizer

July 20, 20221 min read
image
Image Credit: docs.microsoft.com

While debugging .NET code, inspecting a large and complex collections can be difficult. Hence, Microsoft added since Visual Studio 17.2 Preview 2 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 Debugger Visualizer
Image Credit: docs.microsoft.com

Filtering

The IEnumerable visualizer can filter data based on the typed filter string. The filtering supports special characters and is not case-sensitive. You just need to specify the desired string in the filter box on the top of the IEnumerable visualizer and press Enter. Then the visualizer view will get updated, and the visualizer will return all the rows that have a value that matches the filter string.

IEnumerable Debugger Visualizer Filter
Image Credit: docs.microsoft.com

CSV Export

It is possible to export the data from the IEnumerable visualizer in CSV format. In order to do that, you just use the dropdown on the top right corner and select CSV. This feature can also export filtered and sorted data in the view of the IEnumerable visualizer.

IEnumerable Debugger Visualizer Export
Image Credit: docs.microsoft.com