Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is function-evaluation in the context of debugging and how does it affect me?

affect context debugging
0
Posted

What is function-evaluation in the context of debugging and how does it affect me?

0

When the debugger attempts to evaluate the properties for the objects in VB, C# or J# it has to run code in the program you’re debugging. Depending on how the property is coded it’s possible that it will not be able to finish running before an answer is expected to be received by Visual Studio. When this happens, the VS Debugger essentially tells the debuggee to abort the evaluation. This abort can sometimes be done safely, but oftentimes it cannot. In those cases, the debugger has to forcibly cause the debuggee to finish whatever it is trying to do. If you’re having trouble visualizing such a situation, take a peek at this implementation of a class with two really obviously bad properties: class MyClass { int x = 0; public int MyBadProperty1 { get { MessageBox.Show(“Hi there.”); return 10; } } public int MyBadProperty2 { get { while(true) x++; return x; } } } Hopefully, it’s obvious that both properties are really bad and can potentially cause a huge amount of grief while debugging (L

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123