MVC 5 Areas in VB.NET not working
Using Visual Studio 2013 Professional, I create a new project.
Select Visual Basic, then Web, then Web Application. I choose MVC. No authentication. Create.
Then I add an area called "Test". A controller called "Test" and a view called "Index".
I hit F5, build and run the project and give me HTTP 404
I am doing the EXACT ART (literally the same steps), except for choosing C # over Visual Basic when building a web application. And it works.
Yes, AreaRegistration.RegisterAllAreas () is called. This is a new default project with the steps outlined above, but it just doesn't work whereas the C # version.
Why is this, how can I fix it? My client needs it in VB.NET, not C #
edit Here's what RouteDebugger says:
Matches Current Request | Url | Defaults | Constraints | DataTokens
False | __browserLink/requestData/{requestId} (null) (null) (null)
True | Test/{controller}/{action}/{id} action = Index, id = UrlParameter.Optional (empty) Namespaces = WebApplication2.Areas.Test.*, area = Test, UseNamespaceFallback = False
False | {resource}.axd/{*pathInfo} (null) (empty) (null)
True | {controller}/{action}/{id} controller = Home, action = Index, id = UrlParameter.Optional (empty) (empty)
True | {*catchall} (null) (null) (null)
source to share
Thanks to this post: fooobar.com/questions/2178942 / ...
It emphasizes that, by default, VB.NET Areas Controllers do not automatically add the namespace required for this. After adding: Namespace Areas.Test.Controllers
to TestController, it worked.
Thanks to Microsoft for making such a difficult and stupid experience.
source to share