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..9ec3a6c75507 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.AspNetCoreSharedUrlFormat)] public static class WebHost { /// diff --git a/src/Hosting/Abstractions/src/IWebHost.cs b/src/Hosting/Abstractions/src/IWebHost.cs index 25dbbc87c388..d4daa2ba97af 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.AspNetCoreSharedUrlFormat)] public interface IWebHost : IDisposable { /// diff --git a/src/Hosting/Abstractions/src/IWebHostBuilder.cs b/src/Hosting/Abstractions/src/IWebHostBuilder.cs index 78fde1cb897d..e4c6faf058c0 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.AspNetCoreSharedUrlFormat)] 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..81abcbda82a6 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.AspNetCoreSharedUrlFormat)] 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..dd677f64c43c 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.AspNetCoreSharedUrlFormat)] 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..15ba29649fed 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.AspNetCoreSharedUrlFormat)] 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.AspNetCoreSharedUrlFormat)] 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.AspNetCoreSharedUrlFormat)] public IWebHost Host { get diff --git a/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs b/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs index b2e6b0a9619e..35be2cfeb15d 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.AspNetCoreSharedUrlFormat)] 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.AspNetCoreSharedUrlFormat)] 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..51b67cffd20b 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.AspNetCoreSharedUrlFormat)] 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..197c2040a466 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.AspNetCoreSharedUrlFormat)] public static class WebHostWindowsServiceExtensions { /// diff --git a/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs b/src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs index bd835a21a673..4d469579fea6 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.AspNetCoreSharedUrlFormat)] public IList KnownNetworks => _knownNetworks; /// diff --git a/src/Middleware/HttpOverrides/src/IPNetwork.cs b/src/Middleware/HttpOverrides/src/IPNetwork.cs index 945d3e8eacb7..2302dfbb4d77 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.AspNetCoreSharedUrlFormat)] 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..021c4996fe38 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.AspNetCoreSharedUrlFormat)] 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..a63ef2563000 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.AspNetCoreSharedUrlFormat)] 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..4b7bacdd135d 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.AspNetCoreSharedUrlFormat)] 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..fd38d813415d 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.AspNetCoreSharedUrlFormat)] 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..88cc3cd5bfac 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.AspNetCoreSharedUrlFormat)] 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..dacbb1df2df3 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.AspNetCoreSharedUrlFormat)] 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..37519e16659d 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.AspNetCoreSharedUrlFormat)] public class MvcRazorRuntimeCompilationOptions { /// diff --git a/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj b/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj index 76118e0bb154..1a3a8902faf6 100644 --- a/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj +++ b/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj @@ -19,6 +19,10 @@ + + + + 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.AspNetCoreSharedUrlFormat)] 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.AspNetCoreSharedUrlFormat)] 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..0afeec44bef7 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.AspNetCoreSharedUrlFormat)] [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.AspNetCoreSharedUrlFormat)] [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..16a409a0f213 100644 --- a/src/Shared/Obsoletions.cs +++ b/src/Shared/Obsoletions.cs @@ -9,6 +9,7 @@ namespace Microsoft.AspNetCore.Shared; internal sealed class Obsoletions { internal const string RuntimeSharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}"; + internal const string AspNetCoreSharedUrlFormat = "https://aka.ms/aspnet/deprecate/{0}"; internal const string RuntimeTlsCipherAlgorithmEnumsMessage = "KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties are obsolete. Use NegotiatedCipherSuite instead."; internal const string RuntimeTlsCipherAlgorithmEnumsDiagId = "SYSLIB0058";