Take the 2-minute tour ×

I'm getting an intermittent error when I "run" a MVC app from Visual Studio. Here is the error:

Server Error in '/' Application.


Requested URL: /Views/DDF/Edit.vbhtml


My default routing is set up as follows:

Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
    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:


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?

share|improve this question
add comment

2 Answers

When you use visual studio to edit a web application (web forms) there's an option which will load up the page you currently have in the foreground in the editor (its under the properties of the web application, the web tab, and called Start Action: Current Page).

It's pretty crude and just starts up internet explorer (assuming this is your browser) with a path to the location of the file you're editing.

Since this isn't how MVC works, I wouldn't recommend using this option, and instead change it to "Specific Page" or some other option which loads the correct page each time you start


share|improve this answer
Changing it to "Specific Page" like Martin says and then leaving the related text box empty fixes the issue for me - the "root" of the site will always be opened when you run it. –  Rune Jacobsen May 25 '11 at 8:52
While what Rune says is true, this change is not reflected in a file that can be checked in. So be aware that if you're using TFS, you may have to do this on all workstations manually if there are problems. –  cottsak Jul 21 '11 at 0:30
add comment

You're trying to show the view directly, which can't be done.

Visual Studio sometime passes the wrong URL to the browser when you have a view open in it. Don't worry about it and just change the URL to one that you know works.

share|improve this answer
right, so just navigate to localhost:49999/Views/DDF/Edit –  BlackTigerX May 23 '11 at 23:50
add comment

Your Answer


