Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Debugger doesnt step into unused variable declarations

Tags:

c#

debugging

The debugger does not want to step into an unused variable. If I declare (var x = "hola") it doesn't recognize x and says that it doesn't exist in the current context. When I do some work with x then it recognizes it.


1 Answers

That line of code is probably optimized away by the compiler... You might be able to step into it if you turn off optimizations.

like image 79
Tarnay Kálmán Avatar answered Mar 07 '26 19:03

Tarnay Kálmán



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!