Why do I get a 404 error for my controller?

Why do I get a 404 error for my controller?

It is not the solution for this particular post, but hopefully adding this will save someone some time trying to find the issue when they are searching for why they might be getting a 404 error for their controller. Basically, I had spelt “Controller” wrong at the end of my class name. Simple as that!

Are there any ASP.NET Web API controllers that return 404?

No HTTP resource was found that matches the request URI ‘http://localhost:59900/api/Favorites’. No type was found that matches the controller named ‘Favorites’. Any help would be greatly appreciated, I’m losing my mind a little bit over here. 🙂 Thanks!

How to register arearegistration in ASP.NET?

AreaRegistration.RegisterAllAreas (); FilterConfig.RegisterGlobalFilters (GlobalFilters.Filters); RouteConfig.RegisterRoutes (RouteTable.Routes); WebApiConfig.Register (GlobalConfiguration.Configuration); Just saying, this was my problem and changing the order is obvious, but sometimes overlooked and can cause much frustration.

Do you get a 404 when leaving off access modifier?

Leaving off any method access modifier will return an HTTP 404 too. Create a Route attribute for your method. I’m a bit stumped, not sure if this was due to an HTTP output caching issue. Anyways, “all of a sudden it started working properly”. :/ So, the example above worked without me adding or changing anything.

What to do when ASP.NET Core Can’t Find your controller?

Note that in ASP.NET Core 3.x, when you compile an assembly that references ASP.NET Core, an assembly attribute is added to the output, [ApplicationPart]. ASP.NET Core 3.x apps look for this attribute on referenced assemblies and registers them as application parts automatically, so the code above isn’t necessary.

Where is the 404 error page in PHP?

All of those are in the public_html directory. Like I said, it does give me CodeIgniters 404 error page, so I do know it is at least seeing CodeIgniter. I also tried changing the $config [‘base_url’], in the config.php, to my URL. Same error when changing that or leaving it blank. I checked my routes, and all those seem correct.