其他分享
首页 > 其他分享> > Nancy异常01

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://stackoverflow.com/questions/47735133/asp-net-core-synchronous-operations-are-disallowed-call-writeasync-or-set-all

 

 

标签:operations,01,异常,set,AllowSynchronousIO,Nancy,services,true,options
来源: https://www.cnblogs.com/Insist-Y/p/15314285.html