?
Solved

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

Posted on 2011-09-16
2
Medium Priority
?
265 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 1600 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

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

762 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