This project is read-only.

Default (root) controller name in the route raises HTTP 404

Jun 11, 2013 at 2:27 PM
Hello.

I have a simple project for testing your library. So, I register routes as described in the tutorial, code routing for vieww engines also enabled.
            routes.MapCodeRoutes(
                rootController: typeof(Controllers.DefaultController),
                settings: new CodeRoutingSettings
                {
                    UseImplicitIdToken = true
                }
            );
If I go to the route ~/default (for example, h_t_t_p://localhost:2929/default), then I will receive HTTP 404 error? At the same time route ~/default works fine with traditional ASP.NET MVC routing.

Is this behaviour by design? Thank you.
Jun 11, 2013 at 5:06 PM
Edited Jun 11, 2013 at 5:07 PM
Yes, this behavior is by design, and if you look in routes.axd you can see why. Root controllers do not include the controller parameter in the URL.
Marked as answer by maxtoroq on 10/15/2013 at 9:19 AM
Nov 1, 2013 at 1:13 PM
Does that mean we have to use asp.net mvc routing for the default route?
Nov 1, 2013 at 3:14 PM
No, you can use a root controller that doesn't include a default action (Index), or you can use a baseRoute.
Dec 3, 2013 at 9:21 AM
Is there any "easy" way to override this by-design behavior. It creates inconsistent behavior when automating.
Dec 3, 2013 at 2:31 PM
Can you elaborate under what circumstances you'd consider this an undesirable behavior? I'm open to improvement, but I have to understand the problem you are trying to solve.