When debugging the following console program:
class Program
{
static void Main(string[] args)
{
Console.WriteLine(DoIt(false));
Console.WriteLine(DoIt(true));
}
private static Boolean DoIt(Boolean abort)
{
try {
throw new InvalidOperationException();
} catch(Exception ex) {
if (abort) {
return true;
}
Console.WriteLine("Got here");
return false;
}
}
}
Why does the IDE land on the second return statement during the second call to DoIt()? The results of the execution is correct but the debugging experience is misleading.
Is this a known issue?
Is the behavior in VS 2010 the same?