Reputation: 1465
Here is the context:
ASP MVC3 - IIS 7
I am using ElMah configured very well as documented nearly everywhere for MVC. And it is working.
Here is what I have in my config file
<system.web>
<httpRuntime maxRequestLength="1024" enableVersionHeader="false" />
<customErrors mode="On" defaultRedirect="~/Error/Generic" />
...
<system.webServer>
<httpErrors errorMode="Detailed" existingResponse="PassThrough" defaultPath="~/Error/Generic" defaultResponseMode="ExecuteURL"></httpErrors>
Now here is my problem I spent the whole day trying to catch this error : "Maximum request length exceeded" when I submit a file that exceed 1024 bytes
Between asp errors and IIS errors and sometimes IE interception, I'am getting crazy I cannot understand why this is so complicated. I already tried these solutions and none worked for me solution 1 Solution 2
Thank you for your help
Upvotes: 5
Views: 6311
Reputation: 4120
When setting maxRequestLength to 1024 this means 1024 kilobytes, not 1024 bytes. Maybe this is why the exception isn't thrown.
Upvotes: 7