-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Mark WebHostBuilder class as obsolete #62785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
5102b25
54f0cdd
8c3f586
8869208
5407fb0
dd80d9c
3f16853
d028735
95e6eaa
194d366
e87e383
bd4d52f
b146f4d
2f609b9
dfcad52
9134e94
f6c7ee3
161a1b5
5279775
ac08998
d63a4a8
c151d24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,22 +56,26 @@ public static int Main(string[] args) | |
return 12; | ||
case "HangOnStop": | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
|
||
var host = new WebHostBuilder() | ||
.UseIIS() | ||
.UseStartup<Startup>() | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
host.Run(); | ||
|
||
Thread.Sleep(Timeout.Infinite); | ||
} | ||
break; | ||
case "IncreaseShutdownLimit": | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
var host = new WebHostBuilder() | ||
.UseIIS() | ||
.UseShutdownTimeout(TimeSpan.FromSeconds(120)) | ||
.UseStartup<Startup>() | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
|
||
host.Run(); | ||
} | ||
|
@@ -94,11 +98,13 @@ public static int Main(string[] args) | |
return 0; | ||
case "OverriddenServer": | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
var host = new WebHostBuilder() | ||
.UseIIS() | ||
.ConfigureServices(services => services.AddSingleton<IServer, DummyServer>()) | ||
.Configure(builder => builder.Run(async context => { await context.Response.WriteAsync("I shouldn't work"); })) | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
host.Run(); | ||
} | ||
break; | ||
|
@@ -111,6 +117,7 @@ public static int Main(string[] args) | |
#if !FORWARDCOMPAT | ||
case "DecreaseRequestLimit": | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
var host = new WebHostBuilder() | ||
.ConfigureLogging((_, factory) => | ||
{ | ||
|
@@ -124,13 +131,15 @@ public static int Main(string[] args) | |
}) | ||
.UseStartup<Startup>() | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
|
||
host.Run(); | ||
break; | ||
} | ||
#endif | ||
case "ThrowInStartup": | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
var host = new WebHostBuilder() | ||
.ConfigureLogging((_, factory) => | ||
{ | ||
|
@@ -140,6 +149,7 @@ public static int Main(string[] args) | |
.UseIIS() | ||
.UseStartup<ThrowingStartup>() | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
|
||
host.Run(); | ||
} | ||
|
@@ -189,6 +199,7 @@ public static int Main(string[] args) | |
|
||
private static int StartServer() | ||
{ | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
var host = new WebHostBuilder() | ||
.ConfigureLogging((_, factory) => | ||
{ | ||
|
@@ -200,6 +211,7 @@ private static int StartServer() | |
.UseIISIntegration() | ||
.UseStartup<Startup>() | ||
.Build(); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
|
||
host.Run(); | ||
return 0; | ||
|
Uh oh!
There was an error while loading. Please reload this page.