title: ASP.NET MVC are maxRequestLength and maxAllowedContentLength ignored in a subfolder web.config?
body: <p>I have both maxRequestLength and maxAllowedContentLength set in web.config (20MB each) in a sub directory (i.e. Areas\Administration\Views). I have file uploading within administration and when I try to upload a large file (~9MB in this case) I get "Maximum request length exceeded". If I move the two settings to the root it works but I'd prefer not to do so. Any suggestions?</p>
  
  <p>Technology: ASP.NET, .NET 4.0, MVC 3 and IIS 7 on Windows Server 2008 Enterprise.</p>
  
  <p>Stack Trace:</p>
  
  <pre><code>[HttpException (0x80004005): Maximum request length exceeded.]
      System.Web.HttpRequest.GetEntireRawContent() +11472119
      System.Web.HttpRequest.GetMultipartContent() +232
      System.Web.HttpRequest.FillInFormCollection() +345
      System.Web.HttpRequest.get_Form() +157
      Microsoft.Web.Infrastructure.DynamicValidationHelper.&lt;&gt;c__DisplayClass12.&lt;ReplaceCollection&gt;b__e() +63
      Microsoft.Web.Infrastructure.DynamicValidationHelper.&lt;&gt;c__DisplayClass12.&lt;ReplaceCollection&gt;b__11() +20
      Microsoft.Web.Infrastructure.DynamicValidationHelper.DeferredCountArrayList.get_Count() +20
      System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +34
      System.Web.HttpRequest.get_Form() +212
      System.Web.Mvc.HttpRequestExtensions.GetHttpMethodOverride(HttpRequestBase request) +160
      System.Web.Mvc.AcceptVerbsAttribute.IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) +55
      System.Linq.Enumerable.All(IEnumerable`1 source, Func`2 predicate) +149
      System.Web.Mvc.ActionMethodSelector.RunSelectionFilters(ControllerContext controllerContext, List`1 methodInfos) +428
      System.Web.Mvc.ReflectedControllerDescriptor.FindAction(ControllerContext controllerContext, String actionName) +140
      System.Web.Mvc.ControllerActionInvoker.FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, String actionName) +27
      System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +148
      System.Web.Mvc.Controller.ExecuteCore() +159
      System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
      System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +62
      System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +20
      System.Web.Mvc.&lt;&gt;c__DisplayClasse.&lt;EndProcessRequest&gt;b__d() +54
      System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +375
  </code></pre>