Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Evaluate expressions during debugging in Visual Studio

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?

like image 473
szab.kel Avatar asked Feb 23 '18 08:02

szab.kel


People also ask

How do you start a Debug session to evaluate expressions?

To open the Debug Console, use the Debug Console action at the top of the Debug pane or use the View: Debug Console command (Ctrl+Shift+Y). Expressions are evaluated after you press Enter and the Debug Console REPL shows suggestions as you type.

How do I see variable values in Visual Studio debugging?

Hover over a variable to see its value. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.


1 Answers

I have the exact same issue.

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

screenshot

like image 88
Luckybug Avatar answered Sep 30 '22 16:09

Luckybug