From 147383ba9eb0fae5a581afe6d2aed4413f181a9c Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:37:50 -1000 Subject: [PATCH 01/13] edit asp0028 /1 --- aspnetcore/diagnostics/asp0028.md | 40 ++++++++++--------- .../samples/9.x/StaticFilesSample/Program.cs | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 99a03bce9e8d..f63c75eb0f77 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,11 +17,17 @@ uid: diagnostics/asp0028 ## Cause -On the server machine that supports IPv6, listening to `Any`, rather than `IPv6Any` will either not work or be slower than necessary, because of the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). +`IPv6Any` is preferred to `Any` because `Any` is slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). -At the moment of current article publishing, in case of HTTP/1.x or HTTP/2.0 a name like `localhost` will resolve to `[::1]`, which won't be accepted by the server, forcing a retry with `127.0.0.1` (i.e. failed attempt before each connection). +`127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. + +Currently, when using HTTP/1.x or HTTP/2.0: + +* `localhost` resolve to `[::1]`. +* `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, and the cycle continues. + +Using `Any` with the preceding conditions is reported with a diagnostic message: -This usage will be reported with a diagnostic message: ```csharp .UseKestrel().ConfigureKestrel(options => { @@ -31,36 +37,32 @@ This usage will be reported with a diagnostic message: ## Rule description -The recommended way is to setup Kestrel to listen on `IPv6Any`. +The recommended way to configure Kestrel to listen for incoming connections on all available `IPv6` network interfaces is with `IPv6Any`. ## How to fix violations -For the reported code -```csharp -.UseKestrel().ConfigureKestrel(options => -{ - options.Listen(IPAddress.Any, ...); -}) -``` +For the problematic code, replace `Any` with `IPv6Any`: -One can either explicitly change usage to `IPv6Any`: -```csharp +```diff .UseKestrel().ConfigureKestrel(options => { - options.Listen(IPAddress.IPv6Any, ...); +- options.Listen(IPAddress.Any, ...); ++ options.Listen(IPAddress.IPv6Any, ...); }) ``` -or use another invocation - `options.ListenAnyIP()` without specifying any argument explicitly: -```csharp +Alternatively, use the `ListenAnyIP` method without specifying any argument: + +```diff .UseKestrel().ConfigureKestrel(options => { - options.ListenAnyIP(...); +- options.Listen(IPAddress.Any, ...); ++ options.ListenAnyIP(...); }) ``` ## When to suppress warnings -The severity level of this diagnostic is Information. You can suppress warnings if your intention is to disable `IPv6` usage completely on the server. +The `ASP0028` diagnostic has a Information level severity. Suppress warnings if your intention is to disable `IPv6` usage completely on the server, although this comes with the risk of the performance problems mentions in this article -You can disable IPv6 either system-wide, or for .NET only via the [AppCtx switch or environment variable](https://devblogs.microsoft.com/dotnet/dotnet-6-networking-improvements/#an-option-to-globally-disable-ipv6) +`IPv6` can be disabled either system-wide, or for .NET only via the [AppCtx switch or environment variable](https://devblogs.microsoft.com/dotnet/dotnet-6-networking-improvements/#an-option-to-globally-disable-ipv6) diff --git a/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs b/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs index 6bb507555e82..286d94a97037 100644 --- a/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs +++ b/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs @@ -1,4 +1,4 @@ -#define TREE // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS MUL MULT2 +#define RR // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS MUL MULT2 // Test1 #if NEVER #elif DEFAULT From 5368acdb31bdbe81d5314f79755aa93b0d722934 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:39:14 -1000 Subject: [PATCH 02/13] Update aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs --- .../static-files/samples/9.x/StaticFilesSample/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs b/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs index 286d94a97037..6bb507555e82 100644 --- a/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs +++ b/aspnetcore/fundamentals/static-files/samples/9.x/StaticFilesSample/Program.cs @@ -1,4 +1,4 @@ -#define RR // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS MUL MULT2 +#define TREE // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS MUL MULT2 // Test1 #if NEVER #elif DEFAULT From e781c9bd9f4346f2a5c4931a04b2eb3d23af9a85 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:41:21 -1000 Subject: [PATCH 03/13] edit asp0028 /1 --- aspnetcore/toc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 5c8c55da4d3d..56cd71380a83 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -1301,6 +1301,8 @@ items: uid: diagnostics/asp0025 - name: ASP0026 uid: diagnostics/asp0026 + - name: ASP0028 + uid: diagnostics/asp0028 - name: BL0001 uid: diagnostics/bl0001 - name: BL0002 From 17268a45bce27b3c7730f72acd7887882fd16b3e Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:47:58 -1000 Subject: [PATCH 04/13] edit asp0028 /1 --- aspnetcore/diagnostics/asp0028.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index f63c75eb0f77..8ee44aae9811 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,14 +17,14 @@ uid: diagnostics/asp0028 ## Cause -`IPv6Any` is preferred to `Any` because `Any` is slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). +`IPv6Any` is preferred to `Any` because `Any` is less performant than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. -Currently, when using HTTP/1.x or HTTP/2.0: +Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0: -* `localhost` resolve to `[::1]`. -* `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, and the cycle continues. +* `localhost` resolves to `[::1]`. +* `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, creating a repeated cycle. Using `Any` with the preceding conditions is reported with a diagnostic message: From 4e15fe5d869793a01266532aac0e2b911ebf281f Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:53:06 -1000 Subject: [PATCH 05/13] edit asp0028 /1 --- aspnetcore/diagnostics/asp0028.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 8ee44aae9811..5b8c2e45642a 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,7 +17,7 @@ uid: diagnostics/asp0028 ## Cause -`IPv6Any` is preferred to `Any` because `Any` is less performant than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). +[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` is less performant than `IPv6Any`. In some cases, `Any` may not work at all. `Any` has performance problems due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. @@ -26,7 +26,7 @@ Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0: * `localhost` resolves to `[::1]`. * `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, creating a repeated cycle. -Using `Any` with the preceding conditions is reported with a diagnostic message: +Using `Any` with the preceding conditions reports the `ASP0028` diagnostic message: ```csharp .UseKestrel().ConfigureKestrel(options => @@ -51,7 +51,7 @@ For the problematic code, replace `Any` with `IPv6Any`: }) ``` -Alternatively, use the `ListenAnyIP` method without specifying any argument: +Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any argument: ```diff .UseKestrel().ConfigureKestrel(options => @@ -63,6 +63,6 @@ Alternatively, use the `ListenAnyIP` method without specifying any argument: ## When to suppress warnings -The `ASP0028` diagnostic has a Information level severity. Suppress warnings if your intention is to disable `IPv6` usage completely on the server, although this comes with the risk of the performance problems mentions in this article +The `ASP0028` diagnostic has a Information level severity. Suppress warnings if your intention is to disable `IPv6` usage completely on the server, although doing so risks the performance problems mentioned in this article. `IPv6` can be disabled either system-wide, or for .NET only via the [AppCtx switch or environment variable](https://devblogs.microsoft.com/dotnet/dotnet-6-networking-improvements/#an-option-to-globally-disable-ipv6) From f5b40ca79ad3077923fcb7c68f0500875b09a88a Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:58:56 -1000 Subject: [PATCH 06/13] edit asp0028 /1 --- aspnetcore/diagnostics/asp0028.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 5b8c2e45642a..b048a8a9b81a 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -51,7 +51,7 @@ For the problematic code, replace `Any` with `IPv6Any`: }) ``` -Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any argument: +Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments: ```diff .UseKestrel().ConfigureKestrel(options => @@ -63,6 +63,6 @@ Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCor ## When to suppress warnings -The `ASP0028` diagnostic has a Information level severity. Suppress warnings if your intention is to disable `IPv6` usage completely on the server, although doing so risks the performance problems mentioned in this article. +The `ASP0028` diagnostic has [Information](/dotnet/api/microsoft.extensions.logging.loglevel) level severity. Suppress this warning if your intention is to disable `IPv6` usage completely on the server, although doing so risks the performance problems mentioned in this article. `IPv6` can be disabled either system-wide, or for .NET only via the [AppCtx switch or environment variable](https://devblogs.microsoft.com/dotnet/dotnet-6-networking-improvements/#an-option-to-globally-disable-ipv6) From 9e94dc0c7be042cc559a06c96eb7b3945e43c136 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:53:15 -1000 Subject: [PATCH 07/13] Apply suggestions from code review Co-authored-by: Tom Dykstra --- aspnetcore/diagnostics/asp0028.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index b048a8a9b81a..76f6dfee9cbe 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -26,7 +26,7 @@ Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0: * `localhost` resolves to `[::1]`. * `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, creating a repeated cycle. -Using `Any` with the preceding conditions reports the `ASP0028` diagnostic message: +Using `Any` with the preceding conditions causes the `ASP0028` diagnostic message: ```csharp .UseKestrel().ConfigureKestrel(options => From 155f7a5d52652b300ce181a96cbc5dbb32d97650 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:21:44 -1000 Subject: [PATCH 08/13] react to feedback --- aspnetcore/diagnostics/asp0028.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index b048a8a9b81a..12073a25f60d 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,7 +17,11 @@ uid: diagnostics/asp0028 ## Cause +[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` my report the `ASP0028` diagnostic message. + + `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. @@ -43,21 +47,23 @@ The recommended way to configure Kestrel to listen for incoming connections on a For the problematic code, replace `Any` with `IPv6Any`: +Use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments: + ```diff .UseKestrel().ConfigureKestrel(options => { - options.Listen(IPAddress.Any, ...); -+ options.Listen(IPAddress.IPv6Any, ...); ++ options.ListenAnyIP(...); }) ``` -Alternatively, use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments: +Alternatively, use the `IPv6Any` method: ```diff .UseKestrel().ConfigureKestrel(options => { - options.Listen(IPAddress.Any, ...); -+ options.ListenAnyIP(...); ++ options.Listen(IPAddress.IPv6Any, ...); }) ``` From 0b1c2526d5add20e1f6ad8e0d985f49ec855f753 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:31:15 -1000 Subject: [PATCH 09/13] react to feedback --- aspnetcore/diagnostics/asp0028.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index d80a16895cb9..810a64dc042c 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -1,7 +1,7 @@ --- title: "ASP0028: ## Analyzer to suggest using IPAddress.IPv6Any instead of IPAddress.Any if applicable" ms.date: 11/11/2024 -description: "Learn about analysis rule ASP0028: Consider using IPAddress.IPv6Any instead of IPAddress.Any" +description: "Consider using IPAddress.IPv6Any instead of IPAddress.Any" author: deaglegross monikerRange: '>= aspnetcore-10.0' ms.author: deaglegross @@ -19,10 +19,6 @@ uid: diagnostics/asp0028 [IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` my report the `ASP0028` diagnostic message. - - `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0: From 48acce217889d480bc4ddd78a5e894e496a97493 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:34:36 -1000 Subject: [PATCH 10/13] react to feedback --- aspnetcore/diagnostics/asp0028.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 810a64dc042c..2c17fae67e63 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -4,7 +4,7 @@ ms.date: 11/11/2024 description: "Consider using IPAddress.IPv6Any instead of IPAddress.Any" author: deaglegross monikerRange: '>= aspnetcore-10.0' -ms.author: deaglegross +ms.author: dmkorolev uid: diagnostics/asp0028 --- # ASP0028: Consider using `IPAddress.IPv6Any` instead of `IPAddress.Any` From 75d8ba06c0042b788932f0dee8f7a563a796c526 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:06:24 -1000 Subject: [PATCH 11/13] Apply suggestions from code review Co-authored-by: Tom Dykstra --- aspnetcore/diagnostics/asp0028.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 2c17fae67e63..c50406c337c1 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,7 +17,7 @@ uid: diagnostics/asp0028 ## Cause -[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` my report the `ASP0028` diagnostic message. +[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` might report the `ASP0028` diagnostic message. `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6. @@ -26,7 +26,7 @@ Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0: * `localhost` resolves to `[::1]`. * `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, creating a repeated cycle. -Using `Any` with the preceding conditions causes the `ASP0028` diagnostic message: +Using `Any` with the preceding conditions causes the `ASP0028` diagnostic message. Here's an example of the code that can result in these conditions: ```csharp .UseKestrel().ConfigureKestrel(options => @@ -41,7 +41,7 @@ The recommended way to configure Kestrel to listen for incoming connections on a ## How to fix violations -For the problematic code, replace `Any` with `IPv6Any`: +For the problematic code, replace `Any` with `IPv6Any`. Use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments: @@ -53,7 +53,7 @@ Use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestre }) ``` -Alternatively, use the `IPv6Any` method: +Or use the field: ```diff .UseKestrel().ConfigureKestrel(options => From c58c8cc3085eadf5b3ced595cd5ccfb2f20fc005 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:38:54 -1000 Subject: [PATCH 12/13] Update aspnetcore/diagnostics/asp0028.md Co-authored-by: Tom Dykstra --- aspnetcore/diagnostics/asp0028.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index c50406c337c1..24c40ffbfac3 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -43,7 +43,7 @@ The recommended way to configure Kestrel to listen for incoming connections on a For the problematic code, replace `Any` with `IPv6Any`. -Use the [ListenAnyIP](https://source.dot.net/#Microsoft.AspNetCore.Server.Kestrel.Core/KestrelServerOptions.cs,1c84a7db2c1f6892) method without specifying any arguments: +Use the method without specifying any arguments: ```diff .UseKestrel().ConfigureKestrel(options => From 6c863b6f5a75f41a75957381c77e8058f19c7cb2 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:40:43 -1000 Subject: [PATCH 13/13] react to feedback --- aspnetcore/diagnostics/asp0028.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/diagnostics/asp0028.md b/aspnetcore/diagnostics/asp0028.md index 24c40ffbfac3..26370fb0a938 100644 --- a/aspnetcore/diagnostics/asp0028.md +++ b/aspnetcore/diagnostics/asp0028.md @@ -17,7 +17,7 @@ uid: diagnostics/asp0028 ## Cause -[IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). Servers that support `IPv6` might report the `ASP0028` diagnostic message. +On the server machine that supports `IPv6`, [IPv6Any](/dotnet/api/system.net.ipaddress.ipv6any) is preferred to [Any](/dotnet/api/system.net.ipaddress.any) because `Any` can be slower than `IPv6Any`. In some cases, `Any` may not work at all. `Any` can be slower due to the [underlying System types implementation](https://github.com/dotnet/runtime/issues/82404). `127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6.