title: XMLHttpRequest: Network Error Access is denied
body: <p>I have a MVC 4 application making http POSTS requests to a Web API application using angular. Everything works as expected on the development environment, but when deployed to our production environment I'm getting the following error in the console log of the browser</p>
  
  <pre><code>XMLHttpRequest: Network Error 0x80070005, Access is denied.
  </code></pre>
  
  <p>This looks like a CORS issue, I added the following code to my web.config</p>
  
  <pre><code>&lt;system.webServer&gt;
  &lt;handlers&gt;
    &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
    &lt;remove name="OPTIONSVerbHandler" /&gt;
    &lt;remove name="TRACEVerbHandler" /&gt;
    &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
  &lt;/handlers&gt;
  &lt;httpProtocol&gt;
    &lt;customHeaders&gt;
      &lt;clear /&gt;
      &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
      &lt;add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, HEAD, OPTIONS" /&gt;
      &lt;add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" /&gt;
    &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt;
  </code></pre>
  
  <p></p>
  
  <p>and followed the <a href="http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api" rel="nofollow">Enabling Cross-Origin Requests in ASP.NET Web API 2</a> to no avail. Is there anything else I'm missing?</p>