Hi folks,
I'm happily stepping through a piece of code of which my breakpoint was hit within a while loop. The while loop is enclosed in a try catch, but there doesn't seem to be an exception going on. If I keep stepping through the code, no problem, I can stay in this loop forever. However, if I remove my breakpoint, then hit F5, then re-add the breakpoint, it never stops on it again. I'm in an async function.
Here's the code:
Stopwatch timer = new Stopwatch();
timer.Start();
try
{
while (!m_bStop)
{
await Task.Delay(REDRAW_WAIT_TIME);
// breakpoint on the next line stops on the first hit, but not after I hit F5,
// but I can step through forever if I don't hit F5...
while (!m_bStop && m_fAngle - m_fStartAngle < MAX_ANGLE_BETWEEN_HEAD_AND_TAIL)
{
m_fAngle += (float)timer.ElapsedMilliseconds / 1000f / fDegreesPerSecond;
Invalidate();
}
}
}
catch (Exception e)
{
// There's nothing in the console and I don't get the breakpoint on the next line
Console.WriteLine(String.Format("Error (ShowAutoProgress) {0}", e.Message));
}
// I also don't stop at the breakpoint on this next line:
int i = 0;