Visual Studio--Alter Variable While Debugging -


is possible alter variable while debugging?

say example have code:

    string x = "foo"; //would passed-in variable in real world.      var y = "x equals " + x;          ==>[breakpoint] return x;  

is there way manually enter or otherwise change value of "x" when hit break point? , possible "step back" in code in same way can press f11 , step through it?

yes, there 2 ways change variable:

  • use immediate window. typing x = "a new value" change it. also, if want check value of x use ?x
  • you can hover on variable, , when value displays in quickwatch pop-up thing, click on manually change it. (you can add variable watch, or select quickwatch change it).

if step different instruction, there 2 ways too:

  • you can right-click on line want go , select 'set next statement'. works if have hit exception while debugging
  • you can drag yellow arrow indicates current instruction wherever need

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -