Wait for async Task without wrapping exceptions in AggregateException
问题 I am using a library which provides methods ending with ...Async and return Task . I am going to use these in a command line application . So I need to call them synchronously a lot. C# of course does not allow calling these methods in Main method since you cannot use async modifier on Main method. Assume this is the task: var task = datastore.Save(data); I found several solutions like: Tasks.WaitAll(task); task.Wait(); however all these wrap thrown exceptions in AggregateException , I don't