Skip to content

Commit 316f7e1

Browse files
authored
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
1 parent ce31a0d commit 316f7e1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Program
2929
try
3030
{
3131
Log.Information("Starting web host");
32-
BuildWebHost(args).Run();
32+
CreateWebHostBuilder(args).Build().Run();
3333
return 0;
3434
}
3535
catch (Exception ex)
@@ -46,12 +46,11 @@ public class Program
4646

4747
**Then**, add `UseSerilog()` to the web host builder in `BuildWebHost()`.
4848

49-
```csharp
50-
public static IWebHost BuildWebHost(string[] args) =>
51-
WebHost.CreateDefaultBuilder(args)
52-
.UseStartup<Startup>()
53-
.UseSerilog() // <-- Add this line
54-
.Build();
49+
```csharp
50+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
51+
WebHost.CreateDefaultBuilder(args)
52+
.UseStartup<Startup>()
53+
.UseSerilog(); // <-- Add this line;
5554
}
5655
```
5756

0 commit comments

Comments
 (0)