Skip to content

Commit 693f32a

Browse files
committed
id
1 parent b90ef6b commit 693f32a

File tree

23 files changed

+76
-25
lines changed

23 files changed

+76
-25
lines changed

src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests/HostingTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public async Task WebhostLoadsKeyRingBeforeServerStarts()
3636
new FakeServer(onStart: () => tcs.TrySetException(new InvalidOperationException("Server was started before key ring was initialized")))));
3737
#pragma warning restore ASPDEPR004 // Type or member is obsolete
3838

39+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
3940
using (var host = builder.Build())
41+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
4042
{
4143
await host.StartAsync();
4244
}

src/DefaultBuilder/samples/SampleApp/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ private static void CustomApplicationBuilder()
7575
}
7676
private static void DirectWebHost(string[] args)
7777
{
78+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
7879
// Using defaults with a Startup class
7980
using (var host = WebHost.CreateDefaultBuilder(args)
8081
.UseStartup<Startup>()
8182
.Build())
83+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
8284
{
8385
host.Run();
8486
}

src/DefaultBuilder/src/ConfigureWebHostBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ internal ConfigureWebHostBuilder(WebHostBuilderContext webHostBuilderContext, Co
2828
_context = webHostBuilderContext;
2929
}
3030

31-
#pragma warning disable CS0618 // Type or member is obsolete
31+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
3232
IWebHost IWebHostBuilder.Build()
3333
{
3434
throw new NotSupportedException($"Call {nameof(WebApplicationBuilder)}.{nameof(WebApplicationBuilder.Build)}() instead.");
3535
}
36-
#pragma warning restore CS0618 // Type or member is obsolete
36+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
3737

3838
/// <inheritdoc />
3939
public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)

src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebApplicationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ public void WebApplicationBuilderHost_ThrowsWhenBuiltDirectly(CreateBuilderFunc
377377
[MemberData(nameof(CreateBuilderFuncs))]
378378
public void WebApplicationBuilderWebHost_ThrowsWhenBuiltDirectly(CreateBuilderFunc createBuilder)
379379
{
380-
#pragma warning disable CS0618 // Type or member is obsolete
380+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
381381
Assert.Throws<NotSupportedException>(() => ((IWebHostBuilder)createBuilder().WebHost).Build());
382-
#pragma warning restore CS0618 // Type or member is obsolete
382+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
383383
}
384384

385385
[Theory]

src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebHostTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
#pragma warning disable CS0618 // Type or member is obsolete
5+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
56

67
using System.Collections.Concurrent;
78
using System.Diagnostics.Tracing;

src/Hosting/Abstractions/src/HostingAbstractionsWebHostBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Microsoft.AspNetCore.Hosting;
1313
/// <summary>
1414
/// Contains extension methods for configuring the <see cref="IWebHostBuilder" />.
1515
/// </summary>
16-
#pragma warning disable CS0618 // Type or member is obsolete
1716
public static class HostingAbstractionsWebHostBuilderExtensions
1817
{
1918
/// <summary>
@@ -170,11 +169,12 @@ public static IWebHostBuilder UseShutdownTimeout(this IWebHostBuilder hostBuilde
170169
/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to start.</param>
171170
/// <param name="urls">The urls the hosted application will listen on.</param>
172171
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
172+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
173173
public static IWebHost Start(this IWebHostBuilder hostBuilder, [StringSyntax(StringSyntaxAttribute.Uri)] params string[] urls)
174174
{
175175
var host = hostBuilder.UseUrls(urls).Build();
176176
host.StartAsync(CancellationToken.None).GetAwaiter().GetResult();
177177
return host;
178178
}
179+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
179180
}
180-
#pragma warning restore CS0618 // Type or member is obsolete

src/Hosting/Abstractions/src/IWebHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Hosting;
88
/// <summary>
99
/// Represents a configured web host.
1010
/// </summary>
11-
[Obsolete("IWebHost is obsolete. Use IHost instead.")]
11+
[Obsolete("IWebHost is obsolete. Use IHost instead.", DiagnosticId = "ASPDEPR008")]
1212
public interface IWebHost : IDisposable
1313
{
1414
/// <summary>

src/Hosting/Abstractions/src/IWebHostBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface IWebHostBuilder
1515
/// <summary>
1616
/// Builds an <see cref="IWebHost"/> which hosts a web application.
1717
/// </summary>
18-
[Obsolete("IWebHost is obsolete. Use IHost instead.")]
18+
[Obsolete("IWebHost is obsolete. Use IHost instead.", DiagnosticId = "ASPDEPR008")]
1919
IWebHost Build();
2020

2121
/// <summary>

src/Hosting/Hosting/src/GenericHost/HostingStartupWebHostBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public HostingStartupWebHostBuilder(GenericWebHostBuilder builder)
2323
_builder = builder;
2424
}
2525

26-
#pragma warning disable CS0618 // Type or member is obsolete
26+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
2727
public IWebHost Build()
2828
{
2929
throw new NotSupportedException($"Building this implementation of {nameof(IWebHostBuilder)} is not supported.");
3030
}
31-
#pragma warning restore CS0618 // Type or member is obsolete
31+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
3232

3333
public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
3434
{

src/Hosting/Hosting/src/GenericHost/WebHostBuilderBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public WebHostBuilderBase(IHostBuilder builder, WebHostBuilderOptions options)
2626
_config = configBuilder.Build();
2727
}
2828

29-
#pragma warning disable CS0618 // Type or member is obsolete
29+
#pragma warning disable ASPDEPR008 // IWebHost is obsolete
3030
public IWebHost Build()
3131
{
3232
throw new NotSupportedException($"Building this implementation of {nameof(IWebHostBuilder)} is not supported.");
3333
}
34-
#pragma warning restore CS0618 // Type or member is obsolete
34+
#pragma warning restore ASPDEPR008 // IWebHost is obsolete
3535

3636
public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
3737
{

0 commit comments

Comments
 (0)