Await in Catch and Finally
This is just a brief note to publicize a coming improvement to the async language support. With the new compilers, changes to the C# language (e.g., async/await) are easier than they used to be. One improvement that is coming is the use of await in catch and finally blocks. This enables your error-handling/cleanup code to be asynchronous without awkward code mangling. For example, let’s say that you want to (asynchronously) log an exception in one of your async methods. The natural way to write this is: try { await OperationThatMayThrowAsync(); } catch (Exception ex) { await MyLogger.LogAsync(ex); } And this natural code works fine in Visual Studio “14”. However, the currently-released Visual Studio 2013 does not support await in a catch, so you would have to keep some kind of “error flag” and move the actual error handling logic outside the catch block: Exception exception = null; try { await OperationThatMayThrowAsync(); } catch (Exception ex) { exception...