Planned
Last Updated: 10 Sep 2025 07:59 by ADMIN
Scheduled for 2026 Q1 (Feb)
Created by: Janick
Comments: 2
Category: UI for ASP.NET Core
Type: Feature Request
5

Consider the use of TextWriter async methods for the HTML Helpers, for example the WriteInitializationScript methods.  In certain scenarios the use of the synchronous methods causes an exception: System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.

This can be resolved by explicitly enabling synchronous operations

services.Configure<IISServerOptions>(options =>
    {
        options.AllowSynchronousIO = true;
    });

though synchronous operations have been disabled by default at framework level as of .NET 3.0.