遇到异常:Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead
时间:2020-05-22 20:41:41
收藏:0
阅读:802
嗯,在使用 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://www.cnblogs.com/xwgli/p/12939347.html
评论(0)