I have
<system.web>
<httpRuntime maxRequestLength="500000000" />
</system.web>
But when I read web.config via
Configuration config = WebConfigurationManager.OpenWebConfiguration(configPath);
HttpRuntimeSection section =
(HttpRuntimeSection)config.GetSection("system.web/httpRuntime");
I see 4096 value for maxRequestLength!!
How it could be?? Thanks for any clue!
P.S. It is ASP .NET MVC3 Razor project
My guess is that 500,000,000 Kb is above the maximum value for the
maxRequestLengthproperty, so it’s being assigned its default value (4,096). The documentation does not say what’s the maximum value thatmaxRequestLengthcan take, but my guess is 20,97,151 Kb because that’s roughly equal to 2^31 bytes, the maximum value thatintcan store.