title: ASP.NET Web API Error: No HTTP resource was found that matches the request URI
body: <p>I am trying to add the Web API to an existing ASP.NET MVC project. This was originally a ASP.NET MVC 2 web site that was later upgraded to MVC 3 and then again to MVC 4 using the following procedures:</p>
  
  <p><a href="http://www.asp.net/whitepapers/mvc3-release-notes#upgrading" rel="noreferrer">Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3</a></p>
  
  <p><a href="http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806" rel="noreferrer">Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4</a></p>
  
  <p>My Api controller is pretty straightforward. Actually, it is the default template:</p>
  
  <pre><code>public class ValuesController : ApiController
  {
      // GET api/values
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      // GET api/values/5
      public string Get(int id)
      {
          return "value";
      }
  }
  </code></pre>
  
  <p>I've added a class to register de API routes.</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  }
  </code></pre>
  
  <p>That is called from Application_Start</p>
  
  <pre><code>protected void Application_Start()
  {
      AreaRegistration.RegisterAllAreas();
  
      WebApiConfig.Register(GlobalConfiguration.Configuration);
      RouteConfig.RegisterRoutes(RouteTable.Routes);
  }
  </code></pre>
  
  <p>However, when I try to access 'localhost:50315/api/values', I get the following error:</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Message&gt;
      No HTTP resource was found that matches the request URI    'http://localhost:50315/api/values'.
  &lt;/Message&gt;
  &lt;MessageDetail&gt;
      No type was found that matches the controller named 'values'.
  &lt;/MessageDetail&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>According to the Routing Debugger, the route seems to be working properly, the web api route is the first entry that 'Matches Current Request'.</p>