【发布时间】:2021-02-01 10:47:31
【问题描述】:
MaxRequestBodySize 在使用 Azure 应用服务部署到网络服务器时不起作用,但它在我的本地工作。我尝试在我的 .net core 3.1 的 program.cs 和 startup.cs 中进行以下更改,但没有一个起作用。仍然收到 413 (Request Entity Too Large) 错误。
Program.cs:
1. webBuilder.ConfigureKestrel(serverOptions =>
{
serverOptions.Limits.MaxRequestBodySize = long.MaxValue;
})
2. .UseKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
}
Startup.cs
services.Configure<IISServerOptions>(options => options.MaxRequestBodySize = long.MaxValue);
【问题讨论】:
标签: .net-core asp.net-core-3.1