| | |
| | | using Microsoft.Extensions.Configuration; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using Serilog; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | { |
| | | public static void Main(string[] args) |
| | | { |
| | | CreateHostBuilder(args).Build().Run(); |
| | | try |
| | | { |
| | | CreateHostBuilder(args).Build().Run(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log.Fatal(ex, "*** Program Stop ***"); |
| | | } |
| | | finally |
| | | { |
| | | Log.CloseAndFlush(); |
| | | } |
| | | } |
| | | |
| | | public static IHostBuilder CreateHostBuilder(string[] args) => |
| | |
| | | .ConfigureWebHostDefaults(webBuilder => |
| | | { |
| | | webBuilder.UseStartup<Startup>(); |
| | | }).UseServiceProviderFactory(new AutofacServiceProviderFactory()); |
| | | }).UseServiceProviderFactory(new AutofacServiceProviderFactory()) |
| | | .UseSerilog(); |
| | | } |
| | | } |