From 338d52ee560dcab964db0624b73ba0ac03b43eea Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:38:48 -0700 Subject: [PATCH 1/4] long pollling fallback --- docs/core/compatibility/6.0.md | 15 ++--- .../6.0/blazor-long-polling-fallback.md | 63 +++++++++++++++++++ docs/core/compatibility/toc.yml | 4 ++ 3 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md diff --git a/docs/core/compatibility/6.0.md b/docs/core/compatibility/6.0.md index 2fa22923e7c1b..e5258534c6183 100644 --- a/docs/core/compatibility/6.0.md +++ b/docs/core/compatibility/6.0.md @@ -14,13 +14,14 @@ If you're migrating an app to .NET 6, the breaking changes listed here might aff ## ASP.NET Core -| Title | Preview introduced | +| Title | Introduced | | - | - | | [AddDataAnnotationsValidation method made obsolete](aspnet-core/6.0/adddataannotationsvalidation-obsolete.md) | | | [Assemblies removed from Microsoft.AspNetCore.App shared framework](aspnet-core/6.0/assemblies-removed-from-shared-framework.md) | | | [Blazor: Parameter name changed in RequestImageFileAsync method](aspnet-core/6.0/blazor-parameter-name-changed-in-method.md) | Preview 1 | | [Blazor: WebEventDescriptor.EventArgsType property replaced](aspnet-core/6.0/blazor-eventargstype-property-replaced.md) | | | [Blazor: Byte array interop](aspnet-core/6.0/byte-array-interop.md) | Preview 6 | +| [Blazor server: Disable long polling fallback transport](aspnet-core/6.0/blazor-long-polling-fallback.md) | RC 1 | | [Changed MessagePack library in @microsoft/signalr-protocol-msgpack](aspnet-core/6.0/messagepack-library-change.md) | | | [ClientCertificate property doesn't trigger renegotiation for HttpSys](aspnet-core/6.0/clientcertificate-doesnt-trigger-renegotiation.md) | | | [Kestrel: Log message attributes changed](aspnet-core/6.0/kestrel-log-message-attributes-changed.md) | | @@ -37,7 +38,7 @@ If you're migrating an app to .NET 6, the breaking changes listed here might aff ## Core .NET libraries -| Title | Preview introduced | +| Title | Introduced | | - | - | | [API obsoletions with non-default diagnostic IDs](core-libraries/6.0/obsolete-apis-with-custom-diagnostics.md) | Preview 1 | | [Changes to nullable reference type annotations](core-libraries/6.0/nullable-ref-type-annotation-changes.md) | Preview 1-2 | @@ -54,25 +55,25 @@ If you're migrating an app to .NET 6, the breaking changes listed here might aff ## Globalization -| Title | Preview introduced | +| Title | Introduced | | - | - | | [Culture creation and case mapping in globalization-invariant mode](globalization/6.0/culture-creation-invariant-mode.md) | Preview 7 | ## JIT compiler -| Title | Preview introduced | +| Title | Introduced | | - | - | | [Coerce call arguments according to ECMA-335](jit/6.0/coerce-call-arguments-ecma-335.md) | Preview 1 | ## Networking -| Title | Preview introduced | +| Title | Introduced | | - | - | | [WebRequest, WebClient, and ServicePoint are obsolete](networking/6.0/webrequest-deprecated.md) | Preview 1 | ## SDK -| Title | Preview introduced | +| Title | Introduced | | - | - | | [`-p` option for `dotnet run` is deprecated](sdk/6.0/deprecate-p-option-dotnet-run.md) | Preview 6 | | [C# code in templates not supported by earlier versions](sdk/6.0/csharp-template-code.md) | Preview 7 | @@ -83,7 +84,7 @@ If you're migrating an app to .NET 6, the breaking changes listed here might aff ## Windows Forms -| Title | Preview introduced | +| Title | Introduced | | - | - | | [Selected TableLayoutSettings properties throw InvalidEnumArgumentException](windows-forms/6.0/tablelayoutsettings-apis-throw-invalidenumargumentexception.md) | Preview 1 | | [DataGridView-related APIs now throw InvalidOperationException](windows-forms/6.0/null-owner-causes-invalidoperationexception.md) | Preview 4 | diff --git a/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md b/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md new file mode 100644 index 0000000000000..3cf13f3a3dcda --- /dev/null +++ b/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md @@ -0,0 +1,63 @@ +--- +title: "Breaking change: Blazor server: Disable LongPolling fallback transport" +description: "Learn about the breaking change in ASP.NET Core 6.0 where LongPolling is not used as a fallback transport utilized when WebSockets aren't available." +ms.date: 08/12/2021 +no-loc: [ Blazor, WebSocket, LongPolling ] +--- +# Blazor server: Disable long polling fallback transport + +*LongPolling* is a fallback transport utilized when WebSockets aren't available. The LongPolling fallback can lead to a degraded user experience, so it has been removed. Both the client and server now support only WebSockets by default. + +## Version introduced + +ASP.NET Core 6.0 RC 1 + +## Old behavior + +If WebSockets are unavailable for a circuit (for example, due to network issues or browser incompatibility), LongPolling is used instead. + +## New behavior + +| Client | Server | Message | +|---|---|---| +| WS (without browser WS support) | WebSockets | `Unable to connect, please ensure you are using an updated browser that supports WebSockets.` | +| WS (with WS connection being rejected) | WebSockets | `Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection.` | +| WS | LongPolling | `An unhandled error has occurred.` Console Error: `Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. To troubleshoot this, visit https://aka.ms/blazor-server-websockets-error.` | +| LongPolling | WebSockets | `An unhandled error has occurred.` | + +## Reason for change + +This change was mode to improve the overall end-user experience by enforcing WebSocket use. + +## Recommended action + +Ensure WebSockets are functioning as expected with your application. If you must use LongPolling, you can enable it by making the following client and server side changes: + +### Server side + +In `Startup.cs`, replace `endpoints.MapBlazorHub()` with: + +```c# +endpoints.MapBlazorHub(configureOptions: options => +{ + options.Transports = HttpTransportType.WebSockets | HttpTransportType.LongPolling; +}); +``` + +### Client side + +Add the following script to `_Layout.cshtml` before the closing `` tag. The supported fields are (`1`) and . + +```html + +``` + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 93470d79fe8ff..4f3d501b3c45c 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -35,6 +35,8 @@ items: href: aspnet-core/6.0/blazor-eventargstype-property-replaced.md - name: "Blazor: Byte-array interop" href: aspnet-core/6.0/byte-array-interop.md + - name: "Blazor server: Disable long-polling fallback" + href: aspnet-core/6.0/blaozr-long-polling-fallback.md - name: ClientCertificate doesn't trigger renegotiation href: aspnet-core/6.0/clientcertificate-doesnt-trigger-renegotiation.md - name: "Kestrel: Log message attributes changed" @@ -413,6 +415,8 @@ items: href: aspnet-core/6.0/blazor-eventargstype-property-replaced.md - name: "Blazor: Byte-array interop" href: aspnet-core/6.0/byte-array-interop.md + - name: "Blazor server: Disable long-polling fallback" + href: aspnet-core/6.0/blaozr-long-polling-fallback.md - name: ClientCertificate doesn't trigger renegotiation href: aspnet-core/6.0/clientcertificate-doesnt-trigger-renegotiation.md - name: "Kestrel: Log message attributes changed" From 2b45cf5d0b8880aba29fe087943ac9ca2f9f0a6b Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:44:07 -0700 Subject: [PATCH 2/4] fix typo --- docs/core/compatibility/toc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 4f3d501b3c45c..670a37152ba26 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -36,7 +36,7 @@ items: - name: "Blazor: Byte-array interop" href: aspnet-core/6.0/byte-array-interop.md - name: "Blazor server: Disable long-polling fallback" - href: aspnet-core/6.0/blaozr-long-polling-fallback.md + href: aspnet-core/6.0/blazor-long-polling-fallback.md - name: ClientCertificate doesn't trigger renegotiation href: aspnet-core/6.0/clientcertificate-doesnt-trigger-renegotiation.md - name: "Kestrel: Log message attributes changed" @@ -416,7 +416,7 @@ items: - name: "Blazor: Byte-array interop" href: aspnet-core/6.0/byte-array-interop.md - name: "Blazor server: Disable long-polling fallback" - href: aspnet-core/6.0/blaozr-long-polling-fallback.md + href: aspnet-core/6.0/blazor-long-polling-fallback.md - name: ClientCertificate doesn't trigger renegotiation href: aspnet-core/6.0/clientcertificate-doesnt-trigger-renegotiation.md - name: "Kestrel: Log message attributes changed" From b312157adbfb4bb3f16a03ad81283847abce61b5 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:46:58 -0700 Subject: [PATCH 3/4] touch ups --- .../aspnet-core/6.0/blazor-long-polling-fallback.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md b/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md index 3cf13f3a3dcda..b9e7679f92819 100644 --- a/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md +++ b/docs/core/compatibility/aspnet-core/6.0/blazor-long-polling-fallback.md @@ -18,6 +18,8 @@ If WebSockets are unavailable for a circuit (for example, due to network issues ## New behavior +The following table shows the error message you'll receive for each combination of client and server configurations. + | Client | Server | Message | |---|---|---| | WS (without browser WS support) | WebSockets | `Unable to connect, please ensure you are using an updated browser that supports WebSockets.` | @@ -31,7 +33,7 @@ This change was mode to improve the overall end-user experience by enforcing Web ## Recommended action -Ensure WebSockets are functioning as expected with your application. If you must use LongPolling, you can enable it by making the following client and server side changes: +Ensure WebSockets are functioning as expected with your application. If you must use LongPolling, you can enable it by making the following client and server side changes. ### Server side @@ -46,7 +48,7 @@ endpoints.MapBlazorHub(configureOptions: options => ### Client side -Add the following script to `_Layout.cshtml` before the closing `` tag. The supported fields are (`1`) and . +Add the following script to `_Layout.cshtml` before the closing `` tag. The supported fields are (`1`) and (`4`). ```html