I can't get areas working in VS2010
- by devlife
I just upgraded from VS2010 RC to RTM. Now my areas aren't working. I have a Profile area with a Home controller and an Action method Index().
If I try: http://localhost:4951/profile I get a 404 error saying that the resource can't be found. If I try http://localhost:4951/profile/home I get the same error. However, if I try http://localhost:4951/profile/home/index then the view is returned.
Here is my ProfileAreaRegistration:
public class ProfileAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Profile";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Profile_Unlock",
"Profile/Unlock/{userID}/{unlockID}",
new { controller = "Unlock", action = "Index" },
new { userID = new GuidRouteConstraint(), unlockID = new GuidRouteConstraint() }
);
context.MapRoute(
"Profile_default",
"Profile/{controller}/{action}/{id}",
new { action = "Home", id = UrlParameter.Optional }
);
}
Does anyone know what is going wrong?