diff options
author | Hao Kung <HaoK@users.noreply.github.com> | 2021-10-09 01:22:27 +0300 |
---|---|---|
committer | Hao Kung <HaoK@users.noreply.github.com> | 2022-01-03 20:02:19 +0300 |
commit | 75c4d7e9fe8f34195e6b0c268cfb6ed3a91c1404 (patch) | |
tree | a7c1012c9a079c0715c127a5b4297b2a6d5b91b9 | |
parent | 5d7ab313e040c5f89cacaccd3b55fa8800f47172 (diff) |
Use webhostbuilder like other testshaok/nostop
-rw-r--r-- | src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs index f02f1ff8a1..8d30265d66 100644 --- a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs +++ b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text; @@ -184,16 +185,23 @@ public static class Program #endif case "PreloadHostedService": { - var host = new HostBuilder().ConfigureWebHost((c) => - { - c.ConfigureServices(services => + var host = new WebHostBuilder() + .ConfigureServices(services => { services.AddSingleton<IHostedService, PreloadHostedService>(); }) + .ConfigureLogging((_, factory) => + { + factory.AddConsole(); + factory.AddFilter("Console", level => level >= LogLevel.Information); + }) + .UseKestrel() .UseIIS() - .UseStartup<Startup>(); - }); - host.Build().Run(); + .UseIISIntegration() + .UseStartup<Startup>() + .Build(); + + host.Run(); return 0; } |