You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add UrlFormat to ObsoleteAttribute for ASPDEPR diagnostics (#63909)
* Initial plan
* Add UrlFormat to all ASPDEPR obsoletions
Co-authored-by: joperezr <[email protected]>
* Use Obsoletions.AspNetCoreSharedUrlFormat constant for all ASPDEPR UrlFormat references
Co-authored-by: joperezr <[email protected]>
* Fix UrlFormat to use numeric diagnostic IDs instead of full ASPDEPR IDs
Co-authored-by: joperezr <[email protected]>
* Remove unnecessary reference to Obsoletions.cs in the project file
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joperezr <[email protected]>
Co-authored-by: Jose Perez Rodriguez <[email protected]>
Copy file name to clipboardExpand all lines: src/DefaultBuilder/src/WebHost.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
usingMicrosoft.AspNetCore.Http;
11
11
usingMicrosoft.AspNetCore.Routing;
12
12
usingMicrosoft.AspNetCore.Server.Kestrel.Core;
13
+
usingMicrosoft.AspNetCore.Shared;
13
14
usingMicrosoft.Extensions.Configuration;
14
15
usingMicrosoft.Extensions.DependencyInjection;
15
16
usingMicrosoft.Extensions.Hosting;
@@ -21,7 +22,7 @@ namespace Microsoft.AspNetCore;
21
22
/// <summary>
22
23
/// Provides convenience methods for creating instances of <see cref="IWebHost"/> and <see cref="IWebHostBuilder"/> with pre-configured defaults.
23
24
/// </summary>
24
-
[Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
25
+
[Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
Copy file name to clipboardExpand all lines: src/Hosting/Abstractions/src/IWebHost.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,14 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
usingMicrosoft.AspNetCore.Http.Features;
5
+
usingMicrosoft.AspNetCore.Shared;
5
6
6
7
namespaceMicrosoft.AspNetCore.Hosting;
7
8
8
9
/// <summary>
9
10
/// Represents a configured web host.
10
11
/// </summary>
11
-
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
12
+
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
Copy file name to clipboardExpand all lines: src/Hosting/Abstractions/src/IWebHostBuilder.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
+
usingMicrosoft.AspNetCore.Shared;
4
5
usingMicrosoft.Extensions.Configuration;
5
6
usingMicrosoft.Extensions.DependencyInjection;
6
7
usingMicrosoft.Extensions.Logging;
@@ -15,7 +16,7 @@ public interface IWebHostBuilder
15
16
/// <summary>
16
17
/// Builds an <see cref="IWebHost"/> which hosts a web application.
17
18
/// </summary>
18
-
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
19
+
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
[Obsolete("WebHostBuilder is deprecated in favor of HostBuilder and WebApplicationBuilder. For more information, visit https://aka.ms/aspnet/deprecate/004.",DiagnosticId="ASPDEPR004")]
24
+
[Obsolete("WebHostBuilder is deprecated in favor of HostBuilder and WebApplicationBuilder. For more information, visit https://aka.ms/aspnet/deprecate/004.",DiagnosticId="ASPDEPR004",UrlFormat=Obsoletions.AspNetCoreDeprecate004Url)]
/// Contains extensions for managing the lifecycle of an <see cref="IWebHost"/>.
14
15
/// </summary>
15
-
[Obsolete("WebHostExtensions is obsolete. Use Host.CreateDefaultBuilder or WebApplication.CreateBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
16
+
[Obsolete("WebHostExtensions is obsolete. Use Host.CreateDefaultBuilder or WebApplication.CreateBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
@@ -80,7 +81,7 @@ public TestServer(IServiceProvider services, IFeatureCollection featureCollectio
80
81
/// For use with IWebHostBuilder.
81
82
/// </summary>
82
83
/// <param name="builder"></param>
83
-
[Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
84
+
[Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
84
85
publicTestServer(IWebHostBuilderbuilder)
85
86
:this(builder,CreateTestFeatureCollection())
86
87
{
@@ -91,7 +92,7 @@ public TestServer(IWebHostBuilder builder)
91
92
/// </summary>
92
93
/// <param name="builder"></param>
93
94
/// <param name="featureCollection"></param>
94
-
[Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
95
+
[Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
@@ -113,7 +114,7 @@ public TestServer(IWebHostBuilder builder, IFeatureCollection featureCollection)
113
114
/// <summary>
114
115
/// Gets the <see cref="IWebHost" /> instance associated with the test server.
115
116
/// </summary>
116
-
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008")]
117
+
[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.",DiagnosticId="ASPDEPR008",UrlFormat=Obsoletions.AspNetCoreDeprecate008Url)]
0 commit comments