diff --git a/src/Servers/IIS/IIS/src/BadHttpRequestException.cs b/src/Servers/IIS/IIS/src/BadHttpRequestException.cs
index 68b227a8cba6..67e18921ee11 100644
--- a/src/Servers/IIS/IIS/src/BadHttpRequestException.cs
+++ b/src/Servers/IIS/IIS/src/BadHttpRequestException.cs
@@ -9,7 +9,7 @@
namespace Microsoft.AspNetCore.Server.IIS
{
///
- [Obsolete("Moved to Microsoft.AspNetCore.Http.BadHttpRequestException")]
+ [Obsolete("Moved to Microsoft.AspNetCore.Http.BadHttpRequestException. See https://aka.ms/badhttprequestexception for details.")] // Never remove.
public sealed class BadHttpRequestException : Microsoft.AspNetCore.Http.BadHttpRequestException
{
internal BadHttpRequestException(string message, int statusCode, RequestRejectionReason reason)
diff --git a/src/Servers/IIS/IIS/src/Core/IISServerAuthenticationHandler.cs b/src/Servers/IIS/IIS/src/Core/IISServerAuthenticationHandler.cs
index cb4d484fd679..a31ccbe87927 100644
--- a/src/Servers/IIS/IIS/src/Core/IISServerAuthenticationHandler.cs
+++ b/src/Servers/IIS/IIS/src/Core/IISServerAuthenticationHandler.cs
@@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
///
/// The default authentication handler with IIS In-Process
///
- [Obsolete("The IISServerAuthenticationHandler is obsolete and will be removed in a future release.")]
+ [Obsolete("The IISServerAuthenticationHandler is obsolete and will be removed in a future release.")] // Remove after .NET 6.
public class IISServerAuthenticationHandler : IAuthenticationHandler
{
private HttpContext? _context;
diff --git a/src/Servers/IIS/IIS/src/Core/ThrowingWasUpgradedWriteOnlyStream.cs b/src/Servers/IIS/IIS/src/Core/ThrowingWasUpgradedWriteOnlyStream.cs
index 9fdff5b6fe01..6ec6333464f8 100644
--- a/src/Servers/IIS/IIS/src/Core/ThrowingWasUpgradedWriteOnlyStream.cs
+++ b/src/Servers/IIS/IIS/src/Core/ThrowingWasUpgradedWriteOnlyStream.cs
@@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
///
/// Users should not need to instantiate this class.
///
- [Obsolete("The ThrowingWasUpgradedWriteOnlyStream is obsolete and will be removed in a future release.")]
+ [Obsolete("The ThrowingWasUpgradedWriteOnlyStream is obsolete and will be removed in a future release.")] // Remove after .NET 6.
public class ThrowingWasUpgradedWriteOnlyStream : WriteOnlyStream
{
///
diff --git a/src/Servers/IIS/IIS/src/Core/WrappingStream.cs b/src/Servers/IIS/IIS/src/Core/WrappingStream.cs
index 8ecc698d2733..6bbd71c2fd4e 100644
--- a/src/Servers/IIS/IIS/src/Core/WrappingStream.cs
+++ b/src/Servers/IIS/IIS/src/Core/WrappingStream.cs
@@ -107,9 +107,10 @@ public override int EndRead(IAsyncResult asyncResult)
public override void EndWrite(IAsyncResult asyncResult)
=> _inner.EndWrite(asyncResult);
- [Obsolete("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+#pragma warning disable CS0672, SYSLIB0010 // Overrides obsolete member
public override object InitializeLifetimeService()
=> _inner.InitializeLifetimeService();
+#pragma warning restore CS0672, SYSLIB0010 // Overrides obsolete member
public override void Close()
=> _inner.Close();
diff --git a/src/Servers/IIS/IIS/src/Core/WriteOnlyStream.cs b/src/Servers/IIS/IIS/src/Core/WriteOnlyStream.cs
index 0a699ff7b0ab..0fc9c05a782f 100644
--- a/src/Servers/IIS/IIS/src/Core/WriteOnlyStream.cs
+++ b/src/Servers/IIS/IIS/src/Core/WriteOnlyStream.cs
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
///
/// A which only allows for writes.
///
- [Obsolete("The WriteOnlyStream is obsolete and will be removed in a future release.")]
+ [Obsolete("The WriteOnlyStream is obsolete and will be removed in a future release.")] // Remove after .NET 6.
public abstract class WriteOnlyStream : Stream
{
///
diff --git a/src/Servers/IIS/IIS/src/HttpContextExtensions.cs b/src/Servers/IIS/IIS/src/HttpContextExtensions.cs
index 05602353c3ae..d19fb1abbcbd 100644
--- a/src/Servers/IIS/IIS/src/HttpContextExtensions.cs
+++ b/src/Servers/IIS/IIS/src/HttpContextExtensions.cs
@@ -21,7 +21,8 @@ public static class HttpContextExtensions
/// null if the server does not support the feature.
/// May return null or empty if the variable does not exist or is not set.
///
- [Obsolete("This is obsolete and will be removed in a future version. Use " + nameof(HttpContextServerVariableExtensions.GetServerVariable) + " instead.")]
+ [Obsolete("This is obsolete and will be removed in a future version. Use " +
+ nameof(HttpContextServerVariableExtensions.GetServerVariable) + " instead.")] // Never remove.
public static string? GetIISServerVariable(this HttpContext context, string variableName) =>
context.GetServerVariable(variableName);
}
diff --git a/src/Servers/Kestrel/Core/src/BadHttpRequestException.cs b/src/Servers/Kestrel/Core/src/BadHttpRequestException.cs
index 983b2f123430..580288b1e62a 100644
--- a/src/Servers/Kestrel/Core/src/BadHttpRequestException.cs
+++ b/src/Servers/Kestrel/Core/src/BadHttpRequestException.cs
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core
///
/// An exception thrown when a malformed http request has been received.
///
- [Obsolete("Moved to Microsoft.AspNetCore.Http.BadHttpRequestException")]
+ [Obsolete("Moved to Microsoft.AspNetCore.Http.BadHttpRequestException. See https://aka.ms/badhttprequestexception for details.")] // Never remove.
public sealed class BadHttpRequestException : Microsoft.AspNetCore.Http.BadHttpRequestException
{
internal BadHttpRequestException(string message, int statusCode, RequestRejectionReason reason)
diff --git a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs
index a49299c4da34..b6ce1ca9c3a2 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Infrastructure/WrappingStream.cs
@@ -107,9 +107,10 @@ public override int EndRead(IAsyncResult asyncResult)
public override void EndWrite(IAsyncResult asyncResult)
=> _inner.EndWrite(asyncResult);
- [Obsolete("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
+#pragma warning disable CS0672, SYSLIB0010 // Overrides obsolete member
public override object InitializeLifetimeService()
=> _inner.InitializeLifetimeService();
+#pragma warning restore CS0672, SYSLIB0010 // Overrides obsolete member
public override void Close()
=> _inner.Close();
diff --git a/src/Servers/Kestrel/Transport.Libuv/src/LibuvTransportOptions.cs b/src/Servers/Kestrel/Transport.Libuv/src/LibuvTransportOptions.cs
index ee96297f1d07..6545f134e822 100644
--- a/src/Servers/Kestrel/Transport.Libuv/src/LibuvTransportOptions.cs
+++ b/src/Servers/Kestrel/Transport.Libuv/src/LibuvTransportOptions.cs
@@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv
///
/// Provides programmatic configuration of Libuv transport features.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public class LibuvTransportOptions
{
///
@@ -18,7 +18,7 @@ public class LibuvTransportOptions
///
/// Defaults to half of rounded down and clamped between 1 and 16.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public int ThreadCount { get; set; } = ProcessorThreadCount;
///
@@ -27,7 +27,7 @@ public class LibuvTransportOptions
///
/// Defaults to true.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public bool NoDelay { get; set; } = true;
///
@@ -36,13 +36,13 @@ public class LibuvTransportOptions
///
/// Defaults to 128.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public int Backlog { get; set; } = 128;
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public long? MaxReadBufferSize { get; set; } = 1024 * 1024;
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public long? MaxWriteBufferSize { get; set; } = 64 * 1024;
internal Func> MemoryPoolFactory { get; set; } = System.Buffers.SlabMemoryPoolFactory.Create;
diff --git a/src/Servers/Kestrel/Transport.Libuv/src/WebHostBuilderLibuvExtensions.cs b/src/Servers/Kestrel/Transport.Libuv/src/WebHostBuilderLibuvExtensions.cs
index 3bd895455702..95459ea27d97 100644
--- a/src/Servers/Kestrel/Transport.Libuv/src/WebHostBuilderLibuvExtensions.cs
+++ b/src/Servers/Kestrel/Transport.Libuv/src/WebHostBuilderLibuvExtensions.cs
@@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Hosting
///
/// Libuv extensions.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public static class WebHostBuilderLibuvExtensions
{
///
@@ -24,7 +24,7 @@ public static class WebHostBuilderLibuvExtensions
///
/// The Microsoft.AspNetCore.Hosting.IWebHostBuilder.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public static IWebHostBuilder UseLibuv(this IWebHostBuilder hostBuilder)
{
return hostBuilder.ConfigureServices(services =>
@@ -45,7 +45,7 @@ public static IWebHostBuilder UseLibuv(this IWebHostBuilder hostBuilder)
///
/// The Microsoft.AspNetCore.Hosting.IWebHostBuilder.
///
- [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)]
+ [Obsolete("The libuv transport is obsolete and will be removed in a future release. See https://aka.ms/libuvtransport for details.", error: false)] // Remove after .NET 6.
public static IWebHostBuilder UseLibuv(this IWebHostBuilder hostBuilder, Action configureOptions)
{
return hostBuilder.UseLibuv().ConfigureServices(services =>