diff --git a/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj b/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj index 7c8c5ea97aa1..b7b1e259a1e3 100644 --- a/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj +++ b/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj @@ -35,6 +35,10 @@ + + + + diff --git a/src/DefaultBuilder/src/WebHost.cs b/src/DefaultBuilder/src/WebHost.cs index b31a3bfd2d86..68703a76854c 100644 --- a/src/DefaultBuilder/src/WebHost.cs +++ b/src/DefaultBuilder/src/WebHost.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -21,7 +22,7 @@ namespace Microsoft.AspNetCore; /// /// Provides convenience methods for creating instances of and with pre-configured defaults. /// -[Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] +[Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] public static class WebHost { /// diff --git a/src/Hosting/Abstractions/src/IWebHost.cs b/src/Hosting/Abstractions/src/IWebHost.cs index 25dbbc87c388..adfa708db5e5 100644 --- a/src/Hosting/Abstractions/src/IWebHost.cs +++ b/src/Hosting/Abstractions/src/IWebHost.cs @@ -2,13 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Shared; namespace Microsoft.AspNetCore.Hosting; /// /// Represents a configured web host. /// -[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] +[Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] public interface IWebHost : IDisposable { /// diff --git a/src/Hosting/Abstractions/src/IWebHostBuilder.cs b/src/Hosting/Abstractions/src/IWebHostBuilder.cs index 78fde1cb897d..713a1069e1a5 100644 --- a/src/Hosting/Abstractions/src/IWebHostBuilder.cs +++ b/src/Hosting/Abstractions/src/IWebHostBuilder.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -15,7 +16,7 @@ public interface IWebHostBuilder /// /// Builds an which hosts a web application. /// - [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] IWebHost Build(); /// diff --git a/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj b/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj index 9b5d4268cb21..ed3426d65288 100644 --- a/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj +++ b/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj index fb5a2e295272..eb2052e0b5e7 100644 --- a/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj +++ b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj @@ -20,6 +20,7 @@ + diff --git a/src/Hosting/Hosting/src/WebHostBuilder.cs b/src/Hosting/Hosting/src/WebHostBuilder.cs index 23d57a3e59ac..0317c83bd1db 100644 --- a/src/Hosting/Hosting/src/WebHostBuilder.cs +++ b/src/Hosting/Hosting/src/WebHostBuilder.cs @@ -9,6 +9,7 @@ using System.Runtime.ExceptionServices; using Microsoft.AspNetCore.Hosting.Builder; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -20,7 +21,7 @@ namespace Microsoft.AspNetCore.Hosting; /// /// A builder for /// -[Obsolete("WebHostBuilder is deprecated in favor of HostBuilder and WebApplicationBuilder. For more information, visit https://aka.ms/aspnet/deprecate/004.", DiagnosticId = "ASPDEPR004")] +[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)] public class WebHostBuilder : IWebHostBuilder { private readonly HostingEnvironment _hostingEnvironment; diff --git a/src/Hosting/Hosting/src/WebHostExtensions.cs b/src/Hosting/Hosting/src/WebHostExtensions.cs index 157058b84349..4ad56d847d07 100644 --- a/src/Hosting/Hosting/src/WebHostExtensions.cs +++ b/src/Hosting/Hosting/src/WebHostExtensions.cs @@ -4,6 +4,7 @@ #nullable enable using Microsoft.AspNetCore.Hosting.Server.Features; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -12,7 +13,7 @@ namespace Microsoft.AspNetCore.Hosting; /// /// Contains extensions for managing the lifecycle of an . /// -[Obsolete("WebHostExtensions is obsolete. Use Host.CreateDefaultBuilder or WebApplication.CreateBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] +[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)] public static class WebHostExtensions { /// diff --git a/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj b/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj index 77b288b7250f..3dc6a0dbecb3 100644 --- a/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj +++ b/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj @@ -13,6 +13,10 @@ + + + + diff --git a/src/Hosting/TestHost/src/TestServer.cs b/src/Hosting/TestHost/src/TestServer.cs index 8ded1f8e5a72..f3256b860cf7 100644 --- a/src/Hosting/TestHost/src/TestServer.cs +++ b/src/Hosting/TestHost/src/TestServer.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.TestHost; @@ -80,7 +81,7 @@ public TestServer(IServiceProvider services, IFeatureCollection featureCollectio /// For use with IWebHostBuilder. /// /// - [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")] + [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)] public TestServer(IWebHostBuilder builder) : this(builder, CreateTestFeatureCollection()) { @@ -91,7 +92,7 @@ public TestServer(IWebHostBuilder builder) /// /// /// - [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")] + [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)] public TestServer(IWebHostBuilder builder, IFeatureCollection featureCollection) { ArgumentNullException.ThrowIfNull(builder); @@ -113,7 +114,7 @@ public TestServer(IWebHostBuilder builder, IFeatureCollection featureCollection) /// /// Gets the instance associated with the test server. /// - [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] public IWebHost Host { get diff --git a/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs b/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs index b2e6b0a9619e..86e3739d52a3 100644 --- a/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs +++ b/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs @@ -6,6 +6,7 @@ using System.Net.Http; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -53,7 +54,7 @@ public static IWebHostBuilder UseTestServer(this IWebHostBuilder builder, Action /// /// /// - [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] public static TestServer GetTestServer(this IWebHost host) { return (TestServer)host.Services.GetRequiredService(); @@ -64,7 +65,7 @@ public static TestServer GetTestServer(this IWebHost host) /// /// /// - [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] public static HttpClient GetTestClient(this IWebHost host) { return host.GetTestServer().CreateClient(); diff --git a/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj b/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj index 9f788a462f9e..1ab9352c8357 100644 --- a/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj +++ b/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj @@ -18,6 +18,10 @@ + + + + diff --git a/src/Hosting/WindowsServices/src/WebHostService.cs b/src/Hosting/WindowsServices/src/WebHostService.cs index da6bcff59b53..74b5bfc3933a 100644 --- a/src/Hosting/WindowsServices/src/WebHostService.cs +++ b/src/Hosting/WindowsServices/src/WebHostService.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.ServiceProcess; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -12,7 +13,7 @@ namespace Microsoft.AspNetCore.Hosting.WindowsServices; /// Provides an implementation of a Windows service that hosts ASP.NET Core. /// [DesignerCategory("Code")] -[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009")] +[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009", UrlFormat = Obsoletions.AspNetCoreDeprecate009Url)] public class WebHostService : ServiceBase { private readonly IWebHost _host; diff --git a/src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs b/src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs index e9ce70d3e309..3f5790a8e78e 100644 --- a/src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs +++ b/src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs @@ -2,13 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ServiceProcess; +using Microsoft.AspNetCore.Shared; namespace Microsoft.AspNetCore.Hosting.WindowsServices; /// /// Extensions to for hosting inside a Windows service. /// -[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009")] +[Obsolete("Use UseWindowsService and AddHostedService instead. For more information, visit https://aka.ms/aspnet/deprecate/009.", DiagnosticId = "ASPDEPR009", UrlFormat = Obsoletions.AspNetCoreDeprecate009Url)] public static class WebHostWindowsServiceExtensions { /// diff --git a/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs b/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs index bd835a21a673..043994b0a772 100644 --- a/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs +++ b/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.HttpOverrides; +using Microsoft.AspNetCore.Shared; using AspNetIPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork; using IPAddress = System.Net.IPAddress; using IPNetwork = System.Net.IPNetwork; @@ -90,7 +91,7 @@ public class ForwardedHeadersOptions /// Address ranges of known proxies to accept forwarded headers from. /// Obsolete, please use instead /// - [Obsolete("Please use KnownIPNetworks instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005")] + [Obsolete("Please use KnownIPNetworks instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005", UrlFormat = Obsoletions.AspNetCoreDeprecate005Url)] public IList KnownNetworks => _knownNetworks; /// diff --git a/src/Middleware/HttpOverrides/src/IPNetwork.cs b/src/Middleware/HttpOverrides/src/IPNetwork.cs index 945d3e8eacb7..11bfeb0160bc 100644 --- a/src/Middleware/HttpOverrides/src/IPNetwork.cs +++ b/src/Middleware/HttpOverrides/src/IPNetwork.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Net; using System.Net.Sockets; +using Microsoft.AspNetCore.Shared; namespace Microsoft.AspNetCore.HttpOverrides; @@ -11,7 +12,7 @@ namespace Microsoft.AspNetCore.HttpOverrides; /// A representation of an IP network based on CIDR notation. /// Please use instead /// -[Obsolete("Please use System.Net.IPNetwork instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005")] +[Obsolete("Please use System.Net.IPNetwork instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005", UrlFormat = Obsoletions.AspNetCoreDeprecate005Url)] public class IPNetwork { /// diff --git a/src/Middleware/HttpOverrides/src/Microsoft.AspNetCore.HttpOverrides.csproj b/src/Middleware/HttpOverrides/src/Microsoft.AspNetCore.HttpOverrides.csproj index 2a5fbb97210a..15e0c1a903cb 100644 --- a/src/Middleware/HttpOverrides/src/Microsoft.AspNetCore.HttpOverrides.csproj +++ b/src/Middleware/HttpOverrides/src/Microsoft.AspNetCore.HttpOverrides.csproj @@ -18,4 +18,8 @@ + + + + diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs index accf130e6bf0..6d310128fcad 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs @@ -4,13 +4,14 @@ #nullable enable using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Shared; namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// /// Type that provides access to an . /// -[Obsolete("ActionContextAccessor is obsolete and will be removed in a future version. For more information, visit https://aka.ms/aspnet/deprecate/006.", DiagnosticId = "ASPDEPR006")] +[Obsolete("ActionContextAccessor is obsolete and will be removed in a future version. For more information, visit https://aka.ms/aspnet/deprecate/006.", DiagnosticId = "ASPDEPR006", UrlFormat = Obsoletions.AspNetCoreDeprecate006Url)] public class ActionContextAccessor : IActionContextAccessor { internal static readonly IActionContextAccessor Null = new NullActionContextAccessor(); diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs index 60fa2bdf4931..a33dd2ff72c5 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs @@ -4,13 +4,14 @@ #nullable enable using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Shared; namespace Microsoft.AspNetCore.Mvc.Infrastructure; /// /// Defines an interface for exposing an . /// -[Obsolete("IActionContextAccessor is obsolete and will be removed in a future version. For more information, visit https://aka.ms/aspnet/deprecate/006.", DiagnosticId = "ASPDEPR006")] +[Obsolete("IActionContextAccessor is obsolete and will be removed in a future version. For more information, visit https://aka.ms/aspnet/deprecate/006.", DiagnosticId = "ASPDEPR006", UrlFormat = Obsoletions.AspNetCoreDeprecate006Url)] public interface IActionContextAccessor { /// diff --git a/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj b/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj index 2f0ca390d01f..fa00f51a8fe1 100644 --- a/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj +++ b/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj @@ -40,6 +40,7 @@ Microsoft.AspNetCore.Mvc.RouteAttribute + diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs index a15d1155ae54..9be63233422a 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Linq; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.DependencyModel; namespace Microsoft.AspNetCore.Mvc.ApplicationParts; @@ -9,7 +10,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts; /// /// Static class that adds methods to . /// -[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003")] +[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003", UrlFormat = Obsoletions.AspNetCoreDeprecate003Url)] public static class AssemblyPartExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs index 071f204bc552..76d1dc802d4c 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs @@ -2,13 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; +using Microsoft.AspNetCore.Shared; namespace Microsoft.Extensions.DependencyInjection; /// /// Static class that adds razor compilation extension methods. /// -[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003")] +[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003", UrlFormat = Obsoletions.AspNetCoreDeprecate003Url)] public static class RazorRuntimeCompilationMvcBuilderExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs index 6c9462972811..86c1a02df57d 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Shared; using Microsoft.CodeAnalysis.Razor; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; @@ -20,7 +21,7 @@ namespace Microsoft.Extensions.DependencyInjection; /// /// Static class that adds razor runtime compilation extension methods. /// -[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003")] +[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003", UrlFormat = Obsoletions.AspNetCoreDeprecate003Url)] public static class RazorRuntimeCompilationMvcCoreBuilderExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs index b867ac2d8e9c..9bc702527788 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; @@ -9,7 +10,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; /// /// A file provider . /// -[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003")] +[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003", UrlFormat = Obsoletions.AspNetCoreDeprecate003Url)] public class FileProviderRazorProjectItem : RazorProjectItem { private readonly string _root; diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj index a8425cf70113..661eeae9fb01 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj @@ -22,6 +22,10 @@ + + + + diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs index bf352f49114d..6ec9876dcd88 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.ApplicationParts; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; @@ -10,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; /// /// Used to configure razor compilation. /// -[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003")] +[Obsolete("Razor runtime compilation is obsolete and is not recommended for production scenarios. For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. For more information, visit https://aka.ms/aspnet/deprecate/003.", DiagnosticId = "ASPDEPR003", UrlFormat = Obsoletions.AspNetCoreDeprecate003Url)] public class MvcRazorRuntimeCompilationOptions { /// diff --git a/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs b/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs index f66529562e0f..3976128cd958 100644 --- a/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs +++ b/src/Mvc/Mvc.Testing/src/WebApplicationFactory.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Shared; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -577,7 +578,7 @@ private static void EnsureDepsFile() /// The used to /// create the server. /// The with the bootstrapped application. - [Obsolete("IWebHost, which this method uses, is obsolete. Use one of the overloads that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost, which this method uses, is obsolete. Use one of the overloads that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] protected virtual TestServer CreateServer(IWebHostBuilder builder) => new(builder); /// @@ -856,7 +857,7 @@ public DelegatedWebApplicationFactory( _configuration = configureWebHost; } - [Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead.", DiagnosticId = "ASPDEPR008")] + [Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead.", DiagnosticId = "ASPDEPR008", UrlFormat = Obsoletions.AspNetCoreDeprecate008Url)] protected override TestServer CreateServer(IWebHostBuilder builder) => _createServer(builder); protected override TestServer CreateServer(IServiceProvider serviceProvider) => _createServerFromServiceProvider(serviceProvider); diff --git a/src/OpenApi/src/Extensions/OpenApiEndpointConventionBuilderExtensions.cs b/src/OpenApi/src/Extensions/OpenApiEndpointConventionBuilderExtensions.cs index 0f3ed82a2a3e..e29a2dd86167 100644 --- a/src/OpenApi/src/Extensions/OpenApiEndpointConventionBuilderExtensions.cs +++ b/src/OpenApi/src/Extensions/OpenApiEndpointConventionBuilderExtensions.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.OpenApi; using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -29,7 +30,7 @@ public static class OpenApiEndpointConventionBuilderExtensions /// /// The . /// A that can be used to further customize the endpoint. - [Obsolete("WithOpenApi is deprecated and will be removed in a future release. For more information, visit https://aka.ms/aspnet/deprecate/002.", DiagnosticId = "ASPDEPR002")] + [Obsolete("WithOpenApi is deprecated and will be removed in a future release. For more information, visit https://aka.ms/aspnet/deprecate/002.", DiagnosticId = "ASPDEPR002", UrlFormat = Obsoletions.AspNetCoreDeprecate002Url)] [RequiresDynamicCode(TrimWarningMessage)] [RequiresUnreferencedCode(TrimWarningMessage)] public static TBuilder WithOpenApi(this TBuilder builder) where TBuilder : IEndpointConventionBuilder @@ -49,7 +50,7 @@ public static TBuilder WithOpenApi(this TBuilder builder) where TBuild /// The . /// An that returns a new OpenAPI annotation given a generated operation. /// A that can be used to further customize the endpoint. - [Obsolete("WithOpenApi is deprecated and will be removed in a future release. For more information, visit https://aka.ms/aspnet/deprecate/002.", DiagnosticId = "ASPDEPR002")] + [Obsolete("WithOpenApi is deprecated and will be removed in a future release. For more information, visit https://aka.ms/aspnet/deprecate/002.", DiagnosticId = "ASPDEPR002", UrlFormat = Obsoletions.AspNetCoreDeprecate002Url)] [RequiresDynamicCode(TrimWarningMessage)] [RequiresUnreferencedCode(TrimWarningMessage)] public static TBuilder WithOpenApi(this TBuilder builder, Func configureOperation) diff --git a/src/OpenApi/src/Microsoft.AspNetCore.OpenApi.csproj b/src/OpenApi/src/Microsoft.AspNetCore.OpenApi.csproj index 66aa82bbf270..686bdcaf6329 100644 --- a/src/OpenApi/src/Microsoft.AspNetCore.OpenApi.csproj +++ b/src/OpenApi/src/Microsoft.AspNetCore.OpenApi.csproj @@ -29,6 +29,7 @@ + diff --git a/src/Shared/Obsoletions.cs b/src/Shared/Obsoletions.cs index 69b49d150afb..62085ec6b61d 100644 --- a/src/Shared/Obsoletions.cs +++ b/src/Shared/Obsoletions.cs @@ -12,4 +12,13 @@ internal sealed class Obsoletions internal const string RuntimeTlsCipherAlgorithmEnumsMessage = "KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties are obsolete. Use NegotiatedCipherSuite instead."; internal const string RuntimeTlsCipherAlgorithmEnumsDiagId = "SYSLIB0058"; + + // ASP.NET Core deprecated API URLs (not using {0} placeholder - these are explicit URLs) + internal const string AspNetCoreDeprecate002Url = "https://aka.ms/aspnet/deprecate/002"; + internal const string AspNetCoreDeprecate003Url = "https://aka.ms/aspnet/deprecate/003"; + internal const string AspNetCoreDeprecate004Url = "https://aka.ms/aspnet/deprecate/004"; + internal const string AspNetCoreDeprecate005Url = "https://aka.ms/aspnet/deprecate/005"; + internal const string AspNetCoreDeprecate006Url = "https://aka.ms/aspnet/deprecate/006"; + internal const string AspNetCoreDeprecate008Url = "https://aka.ms/aspnet/deprecate/008"; + internal const string AspNetCoreDeprecate009Url = "https://aka.ms/aspnet/deprecate/009"; }