Skip to content

AllowSynchronousIO = false AND CacheTagHelper #19866

Open
@alienwareone

Description

@alienwareone

CacheTagHelper doesn't work without AllowSynchronousIO = true;

Relevant Stacktrace:

System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Compression.DeflateStream.WriteDeflaterOutput()
   at System.IO.Compression.DeflateStream.WriteCore(ReadOnlySpan`1 buffer)
   at System.IO.Compression.DeflateStream.Write(Byte[] array, Int32 offset, Int32 count)
   at System.IO.Compression.GZipStream.Write(Byte[] array, Int32 offset, Int32 count)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionBody.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.FlushInternal(Boolean flushEncoder)
   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter.Write(Char[] values, Int32 index, Int32 count)
   at Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelper.CharBufferHtmlContent.WriteTo(TextWriter writer, HtmlEncoder encoder)

https://github.com/aspnet/Mvc/blob/04ce6cae44fb0cb11470c21769d41e3f8088e8aa/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelper.cs#L264

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-very-fewThis issue impacts very few customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.feature-mvc-razor-viewsFeatures related to the Razor view engine for Razor pages and MVC viewsseverity-blockingThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions