Cannot debug views in MVC2 project, getting "The resource cannot be found" error

Posted by schefdev on Stack Overflow See other posts from Stack Overflow or by schefdev
Published on 2010-04-12T13:49:33Z Indexed on 2010/04/12 13:53 UTC
Read the original article Hit count: 985

Filed under:
|
|

I'm running Visual Studio 2008 sp1 on Win7, with MVC2 RTM installed.

I created a new MVC2 project using the wizard and am unable to debug specific pages. With webforms and even MVC1, I was able to sit on a View page, hit F5, and then have the integrated web server in VS2008 start on the page I was working on. Very handy for building up app logic.

When I try this now I get a "The resource cannot be found" error page.

I retried this just now with a stock new MVC2 Web Application project. Here are the steps I took after creating the new project to reproduce:

  1. Open up project settings. Under the Web subtab, set the Start Action to "Current Page". Leave all the other settings as is.
  2. Open one of the views up (e.g. Account/Register.aspx)
  3. Hit F5 to debug the project
  4. Note that the browser window which displays shows the error message "The resource cannot be found".

The link I saw in my browser for this run was: http://localhost:49471/Views/Account/Register.aspx

I did some googling and found suggestions related to ensuring all HTTP server pieces were installed. I double checked and made sure that "HTTP Errors" and "HTTP Redirection" were both installed.

If I leave the project setting as it was originally, set to "Specific Page" with nothing in the text box, then routing works and I always get the default home page. I'm hoping this isn't the only option.

Thanks!

© Stack Overflow or respective owner

Related posts about mvc

Related posts about mvc2