title: Visual Studio Debugger and Cors not working
body: <p>I have an MVC website, and a Web Api application.  I've added Allow-Origin to both web configs.  </p>
  
  <p>When I debug both applications and use them, I get:</p>
  
  <pre><code>XMLHttpRequest cannot load http://localhost:50053/api/Test/CreateTest. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:1885' is therefore not allowed access. The response had HTTP status code 400.
  </code></pre>
  
  <p>If I publish both applications in IIS8, I don't get this issue.  I've tried manually setting the headers in both the web api and MVC applciations, by overriding the begin-request methods and attaching the header.  </p>
  
  <p>When I debug the headers, the allow origin header is there.  </p>
  
  <p>Anyone know if this is just a bug in visual studio?  I'm unsure if the issue persists when attaching the debugger to the IIS8 published website.</p>
  
  <p>Edit:  This seems to be an issue with IISExpress.  If I publish both applications in IIS8, then debug them by attachign to a process, I do not get this error.</p>
  
  <p>More info: </p>
  
  <p><ol>
  <li>Testing them by using the built in debugger in visual studio (2 instances of VS, which gets launched in IIS express)</li>
  <li>yes the MVC application is in chrome.</li>
  <li>I downloaded a header extension for chrome to show all headers.  The header is there.</li>
  <li>I configured CORS support by adding the header in the web.config for both web api and mvc.  Specifically this:</p>
  
  <blockquote>
  <pre><code>    &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;&lt;/li&gt;
  </code></pre>
    
    <p></ol>
    As I said before, it works when I use IIS8, and not IISExpress.  Seems to just be a bug with IISExpress.</p>
  </blockquote>