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) 

      

structure

+3


source to share


2 answers


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.

0


source


It has nothing to do with either C # or VB.NET ... I guess there is no other controller in the application; if you have a controller named TestController

and you are using standard routing the only and only available route registeredtest/test



0


source







All Articles