Nancy异常01


遇到异常:Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead
嗯,在使用 asp.net core 中遇到这么一个异常:

Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead

解决方法,加入配置:

        public void ConfigureServices(IServiceCollection services)
        {
            // If using Kestrel:
            services.Configure<KestrelServerOptions>(options =>
            {
                options.AllowSynchronousIO = true;
            });

            // If using IIS:
            services.Configure<IISServerOptions>(options =>
            {
                options.AllowSynchronousIO = true;
            });
        }
转自:https://*.com/questions/47735133/asp-net-core-synchronous-operations-are-disallowed-call-writeasync-or-set-all

 

 
上一篇:【Azure 应用服务】记一次 App Service 部分请求一直返回 401 "No Authority" 的情况


下一篇:Win10注册表相关配置