From 316f7e11dc4cb4a767aad3fe30d9f039658ab55d Mon Sep 17 00:00:00 2001 From: pmorong Date: Tue, 4 Jun 2019 13:22:01 -0700 Subject: [PATCH] Update to initial configuration pattern Update to the initial configuration pattern so that it matches up-to-date asp.net core pattern. ref: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1#changes-to-main --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e9ac819..ecea317 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ public class Program try { Log.Information("Starting web host"); - BuildWebHost(args).Run(); + CreateWebHostBuilder(args).Build().Run(); return 0; } catch (Exception ex) @@ -46,12 +46,11 @@ public class Program **Then**, add `UseSerilog()` to the web host builder in `BuildWebHost()`. -```csharp - public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup() - .UseSerilog() // <-- Add this line - .Build(); +```csharp + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .UseSerilog(); // <-- Add this line; } ```