title: IIS Express 8 - Max allowed length
body: <p>In case the below is too long, my question is whether IIS Express 8 in Visual Studio 2013 obeys the <code>maxAllowedContentLength</code> attribute or if it has some overriding value that prevents large requests</p>
  
  <hr>
  
  <p>When debugging some webapi calls against Visual Studio 2013, I'm receiving this error:</p>
  
  <p><code>Maximum request length exceeded.</code></p>
  
  <p>I searched the internet and everything seems to be pointing to these two config entries:</p>
  
  <pre><code>IIS 6-: maxRequestLength
  IIS 7+: maxAllowedContentLength
  </code></pre>
  
  <p>I've added both these config entries to my web.config with a value of 4294967295, just to be safe.  When I try to make the call to the controller, I still receive the error.  </p>
  
  <p>This made me think that I was sending some gigantic amount of data to the server, but fiddler tells me this:</p>
  
  <pre><code>Request Count:   1
  Bytes Sent:      4,327,084      (headers:1,026; body:4,326,058)
  Bytes Received:  3,808      (headers:434; body:3,374)
  </code></pre>
  
  <p>And seeing as how, 4,327,084 &lt; 4,294,967,295 I feel like there shouldn't be any problems with this request.</p>
  
  <p>The next place I thought of looking is my server code:</p>
  
  <pre><code>if (!Request.Content.IsMimeMultipartContent())
  {
      throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
  }
  
  var provider = new MultipartFormDataStreamProvider(@"C:\tmp", Int32.MaxValue);
  
  var task = Request.Content.ReadAsMultipartAsync(provider).ContinueWith(t =&gt;
  {
      if (t.IsFaulted || t.IsCanceled)
          throw t.Exception;   // &lt;== This gets thrown
  </code></pre>
  
  <p>So once again, the size of the request is significantly less than the buffer size for the data stream provider.</p>
  
  <p>So in summary, I have no idea what's going on.  The request is fairly big, but from what I can tell, there's no reason this should be failing.  Is this caused by VS13/IIS Exp8?  Or is there something else I'm missing?</p>
  
  <p>Thanks in advance for any help you can offer.</p>
  
  <hr>
  
  <p><em>Here's the config entry I said I would provide</em></p>
  
  <pre><code>&lt;requestLimits maxAllowedContentLength="4294967295" /&gt;
  </code></pre>
  
  <hr>
  
  <p><em>And here's the full exception</em></p>
  
  <pre><code>System.IO.IOException: Error reading MIME multipart body part. ---&gt; System.Web.HttpException: Maximum request length exceeded.
     at System.Web.HttpBufferlessInputStream.ValidateRequestEntityLength()
     at System.Web.HttpBufferlessInputStream.GetPreloadedContent(Byte[] buffer, Int32&amp; offset, Int32&amp; count)
     at System.Web.HttpBufferlessInputStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
     at System.IO.Stream.&lt;BeginEndReadAsync&gt;b__d(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
     at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
     at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
     at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
     at System.Web.Http.WebHost.SeekableBufferedRequestStream.&lt;ReadAsync&gt;d__0.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
     at System.Net.Http.HttpContentMultipartExtensions.&lt;MultipartReadAsync&gt;d__8.MoveNext()
     --- End of inner exception stack trace ---
     at System.Net.Http.HttpContentMultipartExtensions.&lt;MultipartReadAsync&gt;d__8.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
     at System.Net.Http.HttpContentMultipartExtensions.&lt;ReadAsMultipartAsync&gt;d__0`1.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
     at BICWeb.webservices.controllers.FormsDesignerController.&lt;Post&gt;d__b.MoveNext() in c:\code\BIC_CORE\TRUNK\BIC\src\BICWeb\webservices\controllers\FormsDesignerController.cs:line 300
  </code></pre>
  
  <hr>
  
  <p><em>And the inner exception</em></p>
  
  <pre><code>System.Web.HttpException (0x80004005): Maximum request length exceeded.
     at System.Web.HttpBufferlessInputStream.ValidateRequestEntityLength()
     at System.Web.HttpBufferlessInputStream.GetPreloadedContent(Byte[] buffer, Int32&amp; offset, Int32&amp; count)
     at System.Web.HttpBufferlessInputStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
     at System.IO.Stream.&lt;BeginEndReadAsync&gt;b__d(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
     at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
     at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
     at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
     at System.Web.Http.WebHost.SeekableBufferedRequestStream.&lt;ReadAsync&gt;d__0.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
     at System.Net.Http.HttpContentMultipartExtensions.&lt;MultipartReadAsync&gt;d__8.MoveNext()
  </code></pre>