title: IIS Application Initialization call causing 0x80070032 error in event log
body: <p>I have set up application initialization requests for my Web API application such that when the application pool recycles certain endpoints are hit in order to load Entity Framework etc into the new process. I can see these requests succeeding in my API log:</p>
  
  <blockquote>
    <p>636603400963248247T16P14184 26/04/2018 11:48:16.324 - Request: GET
    <a href="http://localhost/mywebapi/api/v2/warmup/contact/some-guid-value" rel="nofollow noreferrer">http://localhost/mywebapi/api/v2/warmup/contact/some-guid-value</a>
    Host: localhost 
    User-Agent: IIS Application Initialization Warmup
    Content-Length: 0</p>
    
    <p>636603401013021709T8P14184 26/04/2018 11:48:30.297 (8995ms) -
    Response: 200 GET
    <a href="http://localhost/mywebapi/api/v2/warmup/contact/some-guid-value" rel="nofollow noreferrer">http://localhost/mywebapi/api/v2/warmup/contact/some-guid-value</a>
    Content-Type: application/json; charset=utf-8</p>
  </blockquote>
  
  <p>However, whenever the application pool recycles and these requests are made I get two event log entries as follows:</p>
  
  <blockquote>
    <p>Error Message:  An error occurred while communicating with the remote
    host. The error code is 0x80070032.</p>
    
    <p>Exception Type:  System.Web.HttpException</p>
    
    <p>Exception Source:  System.Web</p>
    
    <p>Stack Trace:     at
    System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32
    result, Boolean throwOnDisconnect)    at
    System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()    at
    System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)    at
    System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32
    size)    at System.IO.Stream.&lt;>c.b__46_0(Object ) 
    at System.Threading.Tasks.Task<code>1.InnerInvoke()    at
    System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at System.IO.Stream.EndWrite(IAsyncResult asyncResult)    at
    System.Threading.Tasks.TaskFactory</code>1.FromAsyncCoreLogic(IAsyncResult
    iar, Func<code>2 endFunction, Action</code>1 endAction, Task`1 promise, Boolean
    requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)    at
    System.Web.Http.WebHost.HttpControllerHandler.d__15.MoveNext()</p>
    
    <p>Inner Exception:  The request is not supported. (Exception from
    HRESULT: 0x80070032)</p>
    
    <p>Exception Type:  System.Runtime.InteropServices.COMException</p>
    
    <p>Exception Source:  System.Web</p>
    
    <p>Stack Trace:</p>
  </blockquote>
  
  <p>The timings of the event log entries seem to coincide with the times of the request and response of the final configured application initialization call.</p>
  
  <p>This occurs when running the website on both a local Windows 10 dev box and Windows 2012 servers.</p>
  
  <p>Does anyone know why these errors are being logged (given that the warmup requests seem to succeed) and how I can avoid them?</p>