Reputation: 37633
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
Upvotes: 0
Views: 349
Reputation: 18359
My guess is that 500,000,000 Kb is above the maximum value for the maxRequestLength
property, so it's being assigned its default value (4,096). The documentation does not say what's the maximum value that maxRequestLength
can take, but my guess is 20,97,151 Kb because that's roughly equal to 2^31 bytes, the maximum value that int
can store.
Upvotes: 1
Reputation: 155145
There are a number of things to consider:
If you're using IIS then I recommend using the Configuration editor to investigate configuration precedence.
Upvotes: 1