From c6739cd9503273b8bdfdb263d6477b3bb5b2bb91 Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 3 Sep 2019 13:00:16 -0700 Subject: [PATCH 1/2] Add AspNetCore Preview9 Known issues --- .../3.0/preview/3.0.0-preview-known-issues.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/release-notes/3.0/preview/3.0.0-preview-known-issues.md b/release-notes/3.0/preview/3.0.0-preview-known-issues.md index 19587803..2308305b 100644 --- a/release-notes/3.0/preview/3.0.0-preview-known-issues.md +++ b/release-notes/3.0/preview/3.0.0-preview-known-issues.md @@ -33,6 +33,23 @@ To update the path for every new terminal session, the `export` entry will need ## ASP.NET Core +### Preview 9 + +- **WebSocket connections to IIS In-Process servers will close after the client sends ~30MB** + + WebSocket connections to IIS In-Process servers will close after the client sends ~30MB of data. + + To workaround this issue you can host your app with the [OutOfProcess](https://docs.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.0#out-of-process-hosting-model) hosting model. Or you can change the `MaxRequestBodySize` limit in your app during configuration: + + ```csharp + var builder = new WebHostBuilder() + .UseIIS() + .ConfigureServices(services => + { + services.Configure(options => options.MaxRequestBodySize = long.MaxValue); + }); + ``` + ### Preview 8 - **Starting a client or bi-directional streaming gRPC call with an already canceled `CallOptions.CancellationToken` will hang** From d2715eb7cfd97c83b46d8d720d100091b24ccac5 Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 3 Sep 2019 13:12:52 -0700 Subject: [PATCH 2/2] Update 3.0.0-preview-known-issues.md --- .../3.0/preview/3.0.0-preview-known-issues.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/release-notes/3.0/preview/3.0.0-preview-known-issues.md b/release-notes/3.0/preview/3.0.0-preview-known-issues.md index 2308305b..1b934a40 100644 --- a/release-notes/3.0/preview/3.0.0-preview-known-issues.md +++ b/release-notes/3.0/preview/3.0.0-preview-known-issues.md @@ -39,15 +39,17 @@ To update the path for every new terminal session, the `export` entry will need WebSocket connections to IIS In-Process servers will close after the client sends ~30MB of data. - To workaround this issue you can host your app with the [OutOfProcess](https://docs.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.0#out-of-process-hosting-model) hosting model. Or you can change the `MaxRequestBodySize` limit in your app during configuration: + To workaround this issue you can host your app with the [OutOfProcess](https://docs.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.0#out-of-process-hosting-model) hosting model. Or you can change the `MaxRequestBodySize` limit in your app when handling WebSocket requests by adding the following to your middleware pipeline: ```csharp - var builder = new WebHostBuilder() - .UseIIS() - .ConfigureServices(services => + app.Use(next => context => + { + if (context.WebSockets.IsWebSocketRequest) { - services.Configure(options => options.MaxRequestBodySize = long.MaxValue); - }); + context.Features.Get()?.MaxRequestBodySize = null; + } + return next(context); + }); ``` ### Preview 8