Strange debugger behaviour in async method
问题 When I stepped over breakpoints in my code I have encountered strange behaviour of debugger: public async Task DoSomeWork() { await Task.Run(() => { Thread.Sleep(1000); }); var test = false; if (test) { throw new Exception("Im in IF body!"); } } Debugger goes into if body. It's remarkable that the exception is not really thrown but just looks like it is. So you can't reproduce that if you place breakpoint right on throw . You must place it above and step down to the if body to catch it. The