Industry Insights, Information, and Developer News
When writing asynchronous code using the Microsoft .NET Framework 4.5, it's tempting and easy to declare methods such as async void. Don't do this. You should only use async void on top-level event handlers. Instead, declare your methods as async Task. The async void methods wind up being fire-and-forget methods. That's the case even when awaited, because there's no task to actually await. Also, exceptions won't be properly propagated to your try/catch block.
Posted by Brian Peek on 04/15/2015