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;
});
}
Net Core Api在获取Body的时候出现 Synchronous operations are disallowed. Call WriteAsync or set AllowSynchron
最新推荐文章于 2024-07-12 10:17:43 发布
该博客介绍了如何在ASP.NET Core应用中配置Kestrel或IIS以允许同步IO操作。通过设置`KestrelServerOptions`或`IISServerOptions`的`AllowSynchronousIO`属性为`true`,开发者可以启用这种通常不推荐但在某些场景下必要的功能。

3668

被折叠的 条评论
为什么被折叠?



