Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 3 - Area not working

I am creating an Area using ASP.NET MVC 3, by right clicking the project to add an Area called MyArea.

Project screenshot

Visual Studio 2010 automatically created the AreaRegistration and add RegisterAllAreas() to Application_Start() in Global.asax

But this URL doesn't work: http://localhost:1733/MyArea/AreaHome/Index

Error message

Even though the route seems to be registered.

RouteDebugger

Could anyone see what I am doing wrong?

Thanks in advance.

like image 863
Aximili Avatar asked Oct 12 '22 02:10

Aximili


1 Answers

One of the big things that trips me up when creating new areas is that the template does not automatically reference the new Controller namespaces. You can see what I mean in this similar post:

Cannot load view in area in asp.net mvc 3 using vb.net

It may be in VB.net, but the same solution can be applied.

like image 147
cwharris Avatar answered Oct 20 '22 15:10

cwharris