Evaluate expressions during debugging in Visual Studio

12,967

Solution 1

I have the exact same issue.

After researching I found the closest thing is Immediate Window which give you some intelligence while typing.

screenshot

Solution 2

Simply highlight the expression, right click and select "Evaluate in Debug Console" - it will give you the result in the DEBUG CONSOLE

Solution 3

The Visual Studio debugger includes expression evaluators that work when you enter an expression in the QuickWatch dialog box, Watch window, or Immediate window. The expression evaluators are also work in the Breakpoints window and many other places in the debugger.

Here's a link

Share:
12,967

Related videos on Youtube

szab.kel
Author by

szab.kel

Updated on September 19, 2022

Comments

  • szab.kel
    szab.kel over 1 year

    I am used to Jetbrains IDEA and Java, but now I have a project in .NET/C# and using Visual Studio 2017 (Community).

    If I debug code in IDEA, I can always run code when the execution is stopped at a breakpoint using the 'Evaluate Expression' function of the IDE: https://www.jetbrains.com/help/idea/evaluating-expressions.html (Although it is for PyCharm, the Java one works the same: GIF).

    Is there anything similar in Visual Studio?

    • Paweł Łukasik
      Paweł Łukasik about 6 years
      at least two ways: Watch Window, Immediate Window.
    • Fletcher
      Fletcher about 6 years
      The Visual Studio debugger includes expression evaluators that work when you enter an expression in the QuickWatch dialog box, Watch window, or Immediate window. The expression evaluators are also at work in the Breakpoints window and many other places in the debugger.
  • jmcgrath207
    jmcgrath207 over 2 years
  • Kanhaiya
    Kanhaiya over 2 years
    That's a wide stretch for the term "intelligence".