How do I route my main MVC project to another MVC project?
I have one solution with two MVC projects. I have added links for the second project to the main project. I am creating a new MapRoute in the first project for the second project.
routes.MapRoute(
name: "second",
url: "second",
defaults: new { controller = "Home", action = "Index" },
namespaces: new[] { @"SecondProject.Controllers" });
this code was added to RouteConfig in main project
when i write in the url https: // localhost / second ... doesn't work ... any idea why?
+3
source to share
1 answer
First of all, make sure the namespace path is right at your end. then add below line to route config after route declaration.
myRoute.DataTokens["UseNamespaceFallback"] = false;
you can also refer to stackoverflow link which might be helpful Controller in separate assembly and routing
0
source to share