I have developed an ASP.NET Core Web API which is used to upload files.I am testing the API through postman. When I try to upload file size more than 28 MB it throws request length exceeded error. So I tried to find out solution for this issue. If I increase request length error by changing the value in web.config it works. But my requirement is not to use web.config file. If I increase the MaxRequestBodySize of kestrel server it works fine when I run application through Dotnet CLI but not working when I run application through IIS express from Visual Studio 2019. If I apply [DisableRequestSizeLimit] attribute on POST method it works only on dotnet CLI but not on IIS express. How to increase request length globally for IIS express and Dotnet CLI? Any help is appreciated.
webBuilder.ConfigureKestrel((context, options) =>
{
options.Limits.MaxRequestBodySize = 524288000;
});