Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Page not found occurs unless recompile during debugging using MS VS2010 MVC3 Razor

Posted on 2011-09-16
2
262 Views
Last Modified: 2012-05-12
My first MVC3 razor app.  Running into something I think might be eazy to solve, given my ignorance.  Clicking "run" arrow to debug opens web page with my app.  If I close the browser and click again, I may or may not get "page not found."  Drove me crazy as I was changing code to attempt to fix the problem. Then, I discovered that the only fix I need was to edit any .cs file, type a space, rebuild and then run.  So, now for each edit, to avoid the suprious "page not found" , regardless of what file I am editing, say .js or .cshtml, I bring up a .cs, type my space and rebuild just to avoid the "page not found" error.  This doesn't seem like the intended behavior.

Similarly, if I am just editing a .js file and making a change, if I simply hit "run" to start debugging, the changed code is not necessarily loaded. The old version has been cached and continues to be chosen over the newly edited file when "run" debugging.  Found a workaround to use "CCleaner" app to clear out browser cache. But this also is laborious and doesn't seem like reasonable behaviour, compared to regular VS2008 asp.net debugging.

Settings ? Config ? Attributes ?

Thanks!
0
Comment
Question by:azTop
2 Comments
 
LVL 3

Accepted Solution

by:
nixkuroi earned 400 total points
ID: 36553162
If you go into your project properties, it's probably set to use your "current page" as the default page.  If you set it to a specific URL, it will stop doing that.  The problem is that it's trying to guess which page you want to see based on the file you're currently editing and only goes to the default page when you're not editing a view or a viewmodel.

Try changing the default start page behavior in the project properties and this should put you right.
0
 

Author Closing Comment

by:azTop
ID: 36951787
Selected "Specific Page" and put in the controller name ( minus the word "Controller" ).

Can't use  "..." button as it is going to put in a whole path and file extension ( cshtml ) which is of course not MVC-ish.

Thanks a mil. Shortened my debugging cycle by 10+ seconds!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question