Planned
Last Updated: 27 Feb 2025 11:15 by ADMIN
Scheduled for 2025 Q3 (Aug)
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.