public static async Task <int> Main(string[] args) { try { using var communicator = new Ice.Communicator(ref args); Console.CancelKeyPress += async(sender, eventArgs) => { eventArgs.Cancel = true; await communicator.ShutdownAsync().ConfigureAwait(false); }; return(await RunAsync(communicator, args).ConfigureAwait(false)); } catch (Exception ex) { Console.Error.WriteLine(ex); return(1); } }