Can you change the value of a variable while debugging a C# application?

Can you change the value of a variable while debugging a C# application?
LVL 1
chuang4630Asked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Hi chuang4630,

of course you can from the Locals window or the Watch window or the Immediate window or ...

Cheers!
0
 
gbzhhuConnect With a Mentor Commented:
and that is temporarily.  if you try to put a breakpoint and then modify code, then you will have to restart execution to see the change

for watch window right click on code then quick watch then type over the value
for Immediate window type
someval = something  (depending on type you are assinging to) example textbox

TextBox1.Text = "Hello";
0
 
nguyenvinhtuConnect With a Mentor Commented:
It seems that you can change the value when debugging, however the process will not be effected by you new value. You need to Restart Debug Process. That's the way. Hope to hear your idea
0
 
dunglaCommented:
Look like we are going to answer homework question for a student :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.