So I just spent what felt like an hour debugging why I was receiving a client-side 404 and a server-side System.Web.Http.HttpResponseException on System.Web.Http.dll!System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(System.Net.Http.HttpRequestMessage request) + 0x33f byte; no matter what I tried I could not get my ApiController derivative to receive requests.
In the end, after trying to convert it to a regular Controller to no effect, it occurred to me to change the name from APIController to APIXController only to have everything work.
- Where is it stated that
APIis a reserved controller name? - Where is the full list of reserved controller names?
- Is it possible to bypass this restriction on using
APIControlleras my class name, and if so, how do I go about doing so?
One of the first things I checked was my route configuration, which is the bog standard
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);