Skip to content

Commit 38877f9

Browse files
Add pragma warning suppression for WebHostService obsoletion in WebHostServiceTests
Co-authored-by: BrennanConroy <[email protected]>
1 parent 8b4c6a9 commit 38877f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Hosting/WindowsServices/test/WebHostServiceTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public async Task StopBeforeServiceStarted()
2222
#pragma warning disable ASPDEPR004 // Type or member is obsolete
2323
var host = new WebHostBuilder().UseServer(new FakeServer()).Configure(x => { }).Build();
2424
#pragma warning restore ASPDEPR004 // Type or member is obsolete
25+
#pragma warning disable CS0618 // Type or member is obsolete
2526
var webHostService = new WebHostService(host);
27+
#pragma warning restore CS0618 // Type or member is obsolete
2628
var applicationLifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();
2729

2830
applicationLifetime.StopApplication();
@@ -38,7 +40,9 @@ public async Task StopAfterServiceStarted()
3840
#pragma warning disable ASPDEPR004 // Type or member is obsolete
3941
var host = new WebHostBuilder().UseServer(new FakeServer()).Configure(x => { }).Build();
4042
#pragma warning restore ASPDEPR004 // Type or member is obsolete
43+
#pragma warning disable CS0618 // Type or member is obsolete
4144
var webHostService = new WebHostService(host);
45+
#pragma warning restore CS0618 // Type or member is obsolete
4246
var applicationLifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();
4347

4448
webHostService.Start();

0 commit comments

Comments
 (0)