Solved

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

Posted on 2011-09-16
2
264 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
[X]
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
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

696 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