When I try publishing the web api and deploying on my local iis, the setting below works
var builder = WebApplication.CreateBuilder(args);
builder.Services.Configure<IISServerOptions>(options => options.MaxRequestBodySize = 12000);
But in the server it doesn't work. I noticed that the deployment mode in web.config
is different between my local and the server.
In my local:
hostingModel="inprocess"
while in the server it is:
hostingModel="OutOfProcess"
The IISServerOptions
is for in-process
. What should be the equivalent setting of MaxRequestBodySize that I should apply for out-of-process
?