Troubleshooting “The resource cannot be found.” Error

前端 未结 2 1112
傲寒
傲寒 2021-01-06 16:57

I have an MVC 3 App with a few Areas built into it, one of the areas is my Admin section of my site. Everything was working just fine. I wanted to try MvcContrib Portable Ar

相关标签:
2条回答
  • 2021-01-06 17:40

    Are you calling

    AreaRegistration.RegisterAllAreas();

    on Application_Start in your Global.asax? What server are you using for development Cassini, IISExpress, IIS?

    Edit after reviewing more detailed information.

    In your Admin Area Registration File if you have this code

    context.MapRoute(
            "Admin_default",
            "Admin/{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            new string[] { "CoolProject.Web.Areas.Admin.Contollers" }
        );
    

    I think there is a typo in "CoolProject.Web.Areas.Admin.Contollers" and it should be "CoolProject.Web.Areas.Admin.Controllers"?

    0 讨论(0)
  • 2021-01-06 17:41

    Make sure the namespace is correct in your Controller, as well. If you created the new Area by copying MVC components from another MVC application, for instance (as I did) it's easy to forget to change the namespace!

    0 讨论(0)
提交回复
热议问题