Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

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?
0
chuang4630
Asked:
chuang4630
3 Solutions
 
Éric MoreauSenior .Net ConsultantCommented:
Hi chuang4630,

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

Cheers!
0
 
gbzhhuCommented:
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
 
nguyenvinhtuCommented:
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now