示例#1
0
        public static async Task Main()
        {
            var token = ProcessUtility.CreateCancellationToken();
            var host  = new HostBuilder()
                        .ConfigureLogging(ConfigureLogging)
                        .ConfigureServices(ConfigureServices)
                        .Build();

            try
            {
                await host.RunAsync(token);
            }
            catch (Exception)
            {
                System.Console.WriteLine(Constants.Messages.ShutdownDueUnexpectedError);
            }
            finally
            {
                await Task.Delay(250, token);
            }
        }