how to change area "Admin" to seprate project by MapRoute in asp.net mvc like picture enter image description here

i'm using code:

  namespace App.Web
    {
        public class RouteConfig
        {
            public static void RegisterRoutes(RouteCollection routes)
            {
                routes.IgnoreRoute("{resource}.axd/{*pathInfo}");    
                routes.MapRoute(
                    name: "Default",
                    url: "{controller}/{action}/{id}",
                    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
                );
                var route = routes.MapRoute(
                    "Admin_default",
                    "Admin/{controller}/{action}/{id}",
                    new { controller = "Home", action = "Index", area = "Admin", id = "" },
                    new[] { "app.Admin.Controllers" }
                );
                route.DataTokens["area"] = "Admin";
            }
        }
    }

but when enter url in browser:http://localhost:9531/admin/home/index =>The resource cannot be found.

Related posts

Recent Viewed