title: Getting the "no type was found that matches the controller named" error message during Ajax Request
body: <p>I've seen a lot of topics about this, but unfortunately I believe that each case is a different case (or most of them), and I really would love some experts opinion about my case in particular since I cannot make my code work even after reading through some of the other topics.</p>
  
  <p>Situation: I am using an Ajax Request call in jQuery to a WebService method I have created in an WebApi project together with a MVC 4 Application.</p>
  
  <p>My WebService controller class looks like the default, like this:</p>
  
  <pre><code>public class AdditionalInfoController : ApiController
  {
      //GET api/AdditionalInfo
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      //GET api/AdditionalInfo/5
      public string Get(int id)
      {
          return "value";
      }
  
      //PUT api/AdditionalInfo/5
      public void Put(int id)
      {
          string test = "";
      }
  }
  </code></pre>
  
  <p>My Ajax Request from jQuery looks like this:</p>
  
  <pre><code>function GetAdditionalInfo(obj)
  {
      var request = jQuery.ajax({
          url: "/api/AdditionalInfo/Get",
          type: "GET",
          data: { id: obj.id },
          datatype: "json",
          async: false,
          beforeSend: function () {
          },
          complete: function () {
          }
      })
      .done(function (a,b,c) {
          alert("Additional info was retrieved successfully!");
      })
      .fail(function (a,b,c) {
          alert("An error happened while trying to get the additional info!");
      });
  }
  </code></pre>
  
  <p>My WebAPIConfig file looks like this:</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  }
  </code></pre>
  
  <p>And last but not least, this is my problem: this error message keeps appearing when I browse the returned data variable in .fail and this is what is written:</p>
  
  <pre><code>"{
      "Message":"No HTTP resource was found that matches the request URI      'http://localhost:59096/api/AdditionalInfo/Get?id=1'.",
      "MessageDetail":"No type was found that matches the controller named    'AdditionalInfo'."
  }"
  </code></pre>
  
  <p>I would really appreciate it if someone could help me as soon as possible. Thanks in advance!</p>
  
  <p>Best regards,
  <br>
  Mad</p>