I apologize in advance. This is more of a codebyte than a How-To guide but I think it's neat.
using System; using System.Threading.Tasks; namespace Demonstration { public static class Program { static async Task Main(string[] args) { await Console.Out.WriteLineAsync($"I've turned myself asynchronous, Morty!"); } } }
This code also cooly demonstrates how to use Console with Async/Await.
static void Main(string[] args)
.System.Threading.Tasks
as a namespace.using System; using System.Threading.Tasks; namespace DirectoryTestApp { class Program { static void Main(string[] args) { MainAsync(args).GetAwaiter().GetResult(); } static async Task MainAsync(string[] args) { await Console.Out.WriteLineAsync("I've turned myself Asynchronous, Morty!"); await Console.In.ReadLineAsync(); } } }
This code also cooly demonstrates how to use Console with Async/Await.