IEnumerable Visualizer in Visual Studio 2022: bounding large lazy collections without re-executing IQueryable queries
0 reputation · 29 Jul 2026, 11:47 UTC
Context
Since Visual Studio 2022 (17.x), the IEnumerable Visualizer opens collections in a sortable, filterable grid that loads rows incrementally, instead of forcing one-by-one expansion in the Watch window. Our team is moving debugging habits from DebuggerDisplay/DebuggerTypeProxy attributes toward this visualizer for inspecting large in-memory datasets.
Uncertainty
Many of our enumerables are LINQ over IQueryable backed by a database. Because debugger evaluation runs inside the debugged process, we are unsure whether filtering or scrolling in the visualizer re-executes the underlying query, changes timing, or triggers exceptions that would not occur at that point in normal execution. The attribute-based approach is version-stable but requires code changes and careful side-effect avoidance; the visualizer requires none but is less predictable for lazy sequences.
Questions
- Does the IEnumerable Visualizer enumerate the sequence once and cache rows, or can filtering/sorting cause repeated enumeration of an
IQueryable? - Is there a documented way to bound how many rows the visualizer evaluates, short of materializing with
ToList()in the debugged process? - For side-effecting enumerables, is
DebuggerTypeProxystill the recommended option over the visualizer in current Visual Studio 2022 builds?