title: ASP.NET WebAPI deployed to IIS: Access to web.config denied (IIS searches in wrong path)
body: <p>I have an ASP.NET MVC/WebAPI mixed project which runs just fine in the VS2012 development server. It has a standard MVC <code>{controller}/{action}/{id}</code> route, as well as an additional WebAPI route <code>api/{controller}/{id}</code>. Requests which start with <code>/api/...</code> are directed to WebAPI, the others to normal MVC.</p>
  
  <p>When I deploy it to the local IIS, the normal MVC routes are working. However, <code>/api</code> calls to  WebAPI are resulting in the exception</p>
  
  <pre><code>Access to the path 'C:\inetpub\wwwroot\myapp\web.config' is denied.
  </code></pre>
  
  <p>Then I tried to set the proper security permissions on the <code>inetpub</code> folder and its subfolders. This didn't help anything, and because the normal MVC requests are working, I don't suspect the problem to be security-related.</p>
  
  <p>Then I started <strong>Sysinternals Process Monitor</strong> to see what <code>w3wp.exe</code> is doing during the request. As it turns out, IIS looks for <code>web.config</code> here:</p>
  
  <pre><code>C:\inetpub\wwwroot\myapp\api\web.config
  C:\inetpub\wwwroot\myapp\api\mycontroller\web.config
  </code></pre>
  
  <p>Of course, there is no <code>web.config</code> there.</p>
  
  <p><strong>How can I set up IIS to recognize both routes?</strong></p>