diff --git a/aspnetcore/migration/22-to-30.md b/aspnetcore/migration/22-to-30.md index 9abb2dcf92..f3fb5a8d4a 100644 --- a/aspnetcore/migration/22-to-30.md +++ b/aspnetcore/migration/22-to-30.md @@ -428,6 +428,20 @@ If you have trouble with implementations or other st For more information, see [[Announcement] AllowSynchronousIO disabled in all servers (dotnet/AspNetCore #7644)](https://github.com/dotnet/AspNetCore/issues/7644). +### Output formatter buffering + +[Newtonsoft.Json](https://www.newtonsoft.com/json), , and based output formatters only support synchronous serialization. To allow these formatters to work with the [AllowSynchronousIO](https://github.com/dotnet/aspnetcore/issues/7644) restrictions of the server, MVC buffers the output of these formatters before writing to disk. As a result of buffering, MVC will include the Content-Length header when responding using these formatters. + + supports asynchronous serialization and consequently the `System.Text.Json` based formatter does not buffer. Consider using this formatter for improved performance. + +To disable buffering, applications can configure in their startup: + +```csharp +services.AddControllers(options => options.SuppressOutputFormatterBuffering = true) +``` + +Note that this may result in the application throwing a runtime exception if `AllowSynchronousIO` isn't also configured. + ### Microsoft.AspNetCore.Server.Kestrel.Https assembly removed In ASP.NET Core 2.1, the contents of *Microsoft.AspNetCore.Server.Kestrel.Https.dll* were moved to *Microsoft.AspNetCore.Server.Kestrel.Core.dll*. This was a non-breaking update using `TypeForwardedTo` attributes. For 3.0, the empty *Microsoft.AspNetCore.Server.Kestrel.Https.dll* assembly and the NuGet package have been removed.