title: ASP.NET Web API resource not found error
body: <p>I have added a Api Controller in my asp.net mvc5 web project, along with other controllers...i am contstantly getting resource not found error. please point out mistakes i might be making...</p>
  
  <p>following is my Register method for WebApi routes   </p>
  
  <pre><code>    public static void Register(HttpConfiguration config)
      {
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  </code></pre>
  
  <p>here is the Global.asax.cs</p>
  
  <pre><code> protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes);
          BundleConfig.RegisterBundles(BundleTable.Bundles);
          //GlobalConfiguration.Configure(WebApiConfig.Register);
  
          WebApiConfig.Register(GlobalConfiguration.Configuration);
      }
  </code></pre>
  
  <p>here is my Api controller class</p>
  
  <pre><code>public class SearchController : ApiController
  {
      public IEnumerable&lt;string&gt; GetSearch()
      {
          return new string[] { "value1", "value2" };
      }
  }
  </code></pre>
  
  <p>"<a href="http://sukhdev.com/api/search" rel="nofollow">http://sukhdev.com/api/search</a>" is the url scheme i use to call web api, but it persistenly "The resource cannot be found."</p>