In one mailing list I’m on, someone ran into a problem where they renamed a controller, but ASP.NET MVC could not for the life of it find it. They double checked everything. But ASP.NET MVC simply reported a 404. This is usually where I tell folks to run the following NuGet command: Install-Package RouteDebugger
RouteDebugger is a great way to find out why a route isn’t matching a controller.
In this particular case, the culprit was that the person renamed the controller and forgot to append the “Controller” suffix. So...
99.99999% of the time (yes, I measured it), a controller in ASP.NET MVC is a type, and an action is a method — with reflection as the glue that holds it all together. For most folks, that’s the best way to view how ASP.NET MVC works. But some folks like to dig deeper and get their hands dirty a bit by taking a peek under the hood. Doing so reveals that while the reflection based mapping of controllers types and actions to methods is true by default, it can be easily changed to something else entirely. ASP.NET MVC...