Cannot debug views in MVC2 project, getting "The resource cannot be found" error
- by schefdev
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:
Open up project settings. Under the Web subtab, set the Start Action to "Current Page". Leave all the other settings as is.
Open one of the views up (e.g. Account/Register.aspx)
Hit F5 to debug the project
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!