HTTP Error 404.13 - Not Found The request filtering module is configured to deny a request that exceeds the request content length.
Verify the
For my Core 2.2 MVC project, combining the [RequestSizeLimit(long.MaxValue)] attribute and the web.config above did not work. The web.config alone worked - Just don't use the attribute. The application crashed and closed the browser unexpectedly. Also, because my max request size is 200Mb, if it's possible to generate a 404.13 (req. too large) result, then your normal status code handling will not work for the 404.13 (see Startup.cs, Configure(), the
app.UseStatusCodePagesWithReExecute("/Error/Error", "?statusCode={0}");
line). The status code pages handling works for other codes though. I had to insert custom error status handling into the web.config file to handle 404.13 with a graceful user friendly view. Note that the 'remove' for the 404.13 also appears to remove status code 404 ... and then your Error controller method will not handle a 404. There are two custom error handlers in the web.config below - One for the 404.13 and one for the 404 in order to fix this. Hope this helps someone:
The end result is that all normal status codes are handled by Error/Error, and the 404.13 and 404 status codes have custom handling ... and nice views all around!