Debugging Expression Trees in Visual Studio (Visual Basic)

You can analyze the structure and content of expression trees when you debug your applications. To get a quick overview of the expression tree structure, you can use the DebugView property, which represents expression trees using a special syntax. (Note that DebugView is available only in debug mode.)

Screenshot of the DebugView of expression tree.

Since DebugView is a string, you can use the built-in Text Visualizer to view it across multiple lines, by selecting Text Visualizer from the magnifying glass icon next to the DebugView label.

Screenshot of Text Visualizer applied to results of DebugView.

Alternatively, you can install and use a custom visualizer for expression trees, such as:

To open a visualizer for an expression tree

  1. Click the magnifying glass icon that appears next to the expression tree in DataTips, a Watch window, the Autos window, or the Locals window.

    A list of available visualizers is displayed.:

    Screenshot of the user opening visualizers from Visual Studio.

  2. Click the visualizer you want to use.

See also