title: All requests to ASP.NET Web API return 404 error
body: <p>I have an ASP.NET MVC 4 web site that includes Web API. The site is developed and tested with Visual Studio 2012 and .NET 4.5 on Windows 8 with IIS Express as web server. <strong>In this development environment everything works.</strong></p>
  
  <p>Now it is deployed on a Windows 2008 R2 (SP1) Server with IIS 7.5. .NET 4.0 and 4.5 are installed. The application pool is running with .NET 4.0 in integrated pipeline mode.</p>
  
  <p><strong>In this production environment the MVC web site works, Web API does not.</strong> For every request, no matter if GET or POST I get a 404 error. If I just enter a Web API Url in the browser (IE 9 opened locally on the server) to run a GET request I get a 404 page. If I issue a POST request from a Web API client application I get a 404 as well and the message:</p>
  
  <blockquote>
    <p>No HTTP resource was found that matches the request URI</p>
  </blockquote>
  
  <p><strong>I've created a test website with MVC 4 and Web API as well and deployed it on the same server and the Web API works.</strong> Web API and MVC assemblies have the same version number in both projects.</p>
  
  <p>Furthermore I have added the <a href="http://blogs.msdn.com/b/webdev/archive/2013/04/04/debugging-asp-net-web-api-with-route-debugger.aspx" rel="noreferrer">Web API Route Debugger</a> to the application. If I use a valid route like <code>http://myserver/api/order/12</code> I get the following result:</p>
  
  <p><img src="https://i.stack.imgur.com/TghpG.png" alt="Route Debugger"></p>
  
  <p>For me this means that the correct route template <code>Api/{Controller}/{Id}</code> has been found and correctly parsed into a controller <code>Order</code> and <code>Id=12</code>. The controller (derived from <code>ApiController</code>) exists in the web assembly where also all MVC controllers are.</p>
  
  <p>However, I don't know what the status <code>000</code> could mean and why there is no "Route selecting" section displayed (which is normally the case even if the assembly doesn't contain a single <code>ApiController</code>, see screenshots on the linked page above). Somehow it looks like no <code>ApiController</code> is found or even not searched for or the search fails silently.</p>
  
  <p>The IIS log files don't show anything useful. Changing various application pool settings and using the same app pool for the test and the real application didn't help.</p>
  
  <p>I am currently in the process to remove "features", configuration settings, third party assemblies, etc. from the application to bring it down to the small size of the test application in the end and hoping that at some point it starts to work.</p>
  
  <p>Does somebody have a clue what the issue could be? Also any debugging or logging idea to possibly find the reason is very welcome.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Thanks to Darrel Miller's tip in the comments below I have integrated <a href="http://www.asp.net/web-api/overview/testing-and-debugging/tracing-in-aspnet-web-api" rel="noreferrer">Tracing for ASP.NET Web Api</a>.</p>
  
  <p>For the (GET) request URL <code>http://myserver/api/order/12</code> I get the following:</p>
  
  <ul>
  <li><strong>In development environment, successful</strong> (in short form):</li>
  </ul>
  
  <blockquote>
    <p>Message: <code>http://localhost:50020/api/order/12</code>; Category:
    System.Web.Http.Request</p>
    
    <p><strong>Controller selection and instantiation...</strong></p>
    
    <p>Operator: DefaultHttpControllerSelector; Operation: SelectController;
    Message: Route="controller:order,id:12"; Category:
    System.Web.Http.Controllers</p>
    
    <p>Operator: DefaultHttpControllerSelector; Operation: SelectController;
    Message: Order; Category: System.Web.Http.Controllers</p>
    
    <p>Operator: HttpControllerDescriptor; Operation: CreateController;
    Message: ; Category: System.Web.Http.Controllers</p>
    
    <p>Operator: DefaultHttpControllerActivator; Operation: Create; Message:
    ; Category: System.Web.Http.Controllers</p>
    
    <p>Operator: DefaultHttpControllerActivator; Operation: Create; Message:
    MyApplication.ApiControllers.OrderController; Category:
    System.Web.Http.Controllers</p>
    
    <p><strong>Action selection, parameter binding and action invocation follows...</strong></p>
    
    <p><strong>Content negotiation and formatting for result...</strong></p>
    
    <p>Operator: DefaultContentNegotiator; Operation: Negotiate; Message: Typ = "String" ...
    <em>more</em></p>
    
    <p><strong>Disposing the controller...</strong></p>
    
    <p>Operator: OrderController; Operation: Dispose; Message: ; Category:
    System.Web.Http.Controllers</p>
  </blockquote>
  
  <ul>
  <li><strong>In production environment, not successful</strong> (in short form):</li>
  </ul>
  
  <blockquote>
    <p>Message: <code>http://myserver/api/order/12</code>; Category:
    System.Web.Http.Request</p>
    
    <p>Operator: DefaultHttpControllerSelector; Operation: SelectController;
    Message: Route="controller:order,id:12"; Category:
    System.Web.Http.Controllers</p>
    
    <p><strong>The whole part of controller activation, action selection, parameter binding, action invocation is missing and it follows content
    negotiation and formatting for the error message immediately</strong>:</p>
    
    <p>Operator: DefaultContentNegotiator; Operation: Negotiate; Message:
    Type = "HttpError" ... <em>more</em></p>
  </blockquote>