Skip to content

Commit ad07741

Browse files
authored
Update ReadMe.md
1 parent d9cfe26 commit ad07741

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ If you have other applications such as ASP.NET in the entire project and want to
942942
// Package Import: Microsoft.Extensions.Hosting
943943
var builder = Host.CreateApplicationBuilder(); // don't pass args.
944944
945-
using var host = builder.Build(); // using
945+
using var host = builder.Build(); // use using for host lifetime
946946
ConsoleApp.ServiceProvider = host.Services; // use host ServiceProvider
947947
948948
ConsoleApp.Run(args, ([FromServices] ILogger<Program> logger) => logger.LogInformation("Hello World!"));
@@ -986,7 +986,7 @@ v4 -> v5 Migration Guide
986986
v4 was running on top of `Microsoft.Extensions.Hosting`, so build a Host in the same way and set up a ServiceProvider.
987987

988988
```csharp
989-
using var host = Host.CreateDefaultBuilder().Build();
989+
using var host = Host.CreateDefaultBuilder().Build(); // use using for host lifetime
990990
ConsoleApp.ServiceProvider = host.ServiceProvider;
991991
```
992992

0 commit comments

Comments
 (0)