Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Kung <HaoK@users.noreply.github.com>2021-10-09 01:22:27 +0300
committerHao Kung <HaoK@users.noreply.github.com>2022-01-03 20:02:19 +0300
commit75c4d7e9fe8f34195e6b0c268cfb6ed3a91c1404 (patch)
treea7c1012c9a079c0715c127a5b4297b2a6d5b91b9
parent5d7ab313e040c5f89cacaccd3b55fa8800f47172 (diff)
Use webhostbuilder like other testshaok/nostop
-rw-r--r--src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Program.cs20
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;
}