Async/await in console app

// PM> Install-Package Nito.AsyncEx

using Nito.AsyncEx;

class Program {
static void Main(string[] args) {
AsyncContext.Run(() => MainAsync(args));

static async void MainAsync(string[] args) {
// await Something...

This was an answer on StackOverflow by async/await superstar and blogger Stephen Cleary, who wrote the referenced NuGet package.

Leave a Reply

Your email address will not be published.