I’m using nopCommerce 2.3 and trying to setup a custom Area but the area tries to use the main applications Home controller during run-time and explodes. nopCommerce already has an area called “Admin” that is setup as a separate project and I’m simply trying to follow that architecture. I created a new MVC 3 application and removed all of the login related files and web.config registrations related to profiling and account registration. The area I created is clearly registering with the main application because you can browse its url path. However when you visit its path (http://mysite/backoffice/) it explodes because its trying to use the HomeController.cs file that is in the main application instead of the HomeController.cs that is in my area’s assembly (Backoffice.dll). The assemblies/namespaces are completely different between my area project and the main project so I don’t know why its confused. Is my registration correct below?
Here is my area registration:
namespace Backoffice
{
public class BackofficeRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Backoffice"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Backoffice_default",
"Backoffice/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional, area = AreaName },
new[] { "Backoffice.Controllers" }
);
}
}
}
Figured it out. see here: http://www.nopcommerce.com/boards/t/16098/new-mvc-3-area-registration.aspx#66171