I'm writing a console app that uses lots of async methods; so I've made an async Main method that I can await in:
static void Main(string[] args)
{
MainAsync(args).Wait();
}
static async Task MainAsync(string[] args)
{
// Can use await here
}
However, when an exception occurs; the debugger will always break me on the .Wait()
call. This is not a very good experience.
Is there anything I can do so that the debugger breaks where the exception occurs rather than here? I'm using VS2015 and targeting .NET 4.6 if that influences the answer.