I've read every thread/question on this topic but never found an answer.
In my MVC4 project I've just added a new area called "Admin". I see that AdminAreaRegistration.vb
has been generated by default:
Public Class AdminAreaRegistration
Inherits AreaRegistration
Public Overrides ReadOnly Property AreaName() As String
Get
Return "Admin"
End Get
End Property
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
context.MapRoute( _
"Admin_default", _
"Admin/{controller}/{action}/{id}", _
New With {.action = "Index", .id = UrlParameter.Optional} _
)
End Sub
End Class
I created an "AdminController" and an appropriate view and built the project.
Trying to navigate to
/Admin
/Admin/Admin
/Admin/Admin/Index
All ends in failure
I tried deleting the Admin area and created a new one called Dashboard
with an Admin
controller.
I also modified my MapRoute
context.MapRoute( _
"Dashboard_default", _
"Dashboard/{controller}/{action}/{id}", _
New With {.controller = "Admin", .action = "Index", .id = UrlParameter.Optional} _
)
I tried every combination of namespace for DashboardAreaRegistration
Namespace Areas
Namespace Areas.Dashboard
Namespace Dashboard
I tried every combination of namespace for AdminController
Namespace Areas
Namespace Areas.Dashboard
Namespace Areas.Controllers
Namespace Areas.Dashboard.Controllers
I also tried including the namespace in \App_Start\RouteConfig.vb
Imports Areas
Imports Areas.Dashboard
Imports Areas.Dashboard.Controllers
No change, just 404. What can I do?