private static void MainAsync(string[] args) { Console.TreatControlCAsInput = false; Console.CancelKeyPress += (sender, eventArgs) => { lock (Console.Out) { Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Canceled."); Console.WriteLine(); } }; var cmdOptions = new CmdOptions(); cmdOptions.Process(args, async () => await RunWrexAsync(cmdOptions)); }