I'm getting an intermittent error when I "run" a MVC app from Visual Studio. Here is the error:
Server Error in '/' Application.
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/DDF/Edit.vbhtml
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
My default routing is set up as follows:
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "DDF", .action = "Index", .id = UrlParameter.Optional} )
End Sub
Normally, when I start the app, the browser tries to display the url http://localhost:49999/ and the DDFController's Index action is executed and rendered. Occasionally, VS tries to open the the following url:
http://localhost:49999/Views/DDF/Edit.vbhtml
I don't know why it is trying to display the edit action, or why it adds ".vbhtml" to the url, but it fails with the error.
So, Why is Visual Studio using the wrong url (with the vbhtml extension) and how can I fix it?