Visual Studio ASP.Net MVC undo set as start page action

.Netasp.netasp.net MvcVisual Studio

.Net Problem Overview


I have an web application that I'm working on, it was working fine until my curiosity got the better of me and I right-clicked on a view and chose Set As Start Page option. Now, whenever I run my application it takes me to the Resource Not Found error page. I have the default register route set in my Global config route which was working fine before. I notice that the URL now reads:

http://localhost:1234/Views/User/Login.aspx

instead of

http://localhost:1234/

like it was before. I'm not sure how to undo this action or what was changed, I've looked in my web.config file but I'm not sure what to look for exactly, Help is appreciated.

.Net Solutions


Solution 1 - .Net

You can set it in the Specific Page option in the project properties, just leave the text box empty.

alt text

Solution 2 - .Net

Right click your project in Visual Studio -> Properties -> Web (left hand tab) -> Specific Page with an empty string as the name.

Solution 3 - .Net

Select the specific page then right click on it and select exclude from project, after that again right click on that page and select include in project. It works for me.

Solution 4 - .Net

In some cases, changing the StartUp Project and then setting it to your main project again can help solve this. But only when you have multiple projects in your solution.

Solution 5 - .Net

I appreciate this thread is quite old, but I have just gone through the same process of trying to change my startup page. I tried to change my startup page to Views/Home/Login.cshtml which reported page not found.
my root was http://localhost:63786/ and on startup the site was navigating to http://localhost:63786/Views/Home/Login.cshtml.

After a lot of fiddling about I realised that the root already took me to /Views/ so the startup path I actually needed was Home/Login.cshtml. This still did not work, then I realised that it was leaving the file extension in the path and it should not be. So the startup path should have been Home/Login.

The automatically selected path generated from the ellipsis is incorrect, check that the path is generated correctly and remove the extension and then it should work.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionkingrichard2005View Question on Stackoverflow
Solution 1 - .NetGlennularView Answer on Stackoverflow
Solution 2 - .NetJustin NiessnerView Answer on Stackoverflow
Solution 3 - .NetAayush VermaView Answer on Stackoverflow
Solution 4 - .NetAlberto RojasView Answer on Stackoverflow
Solution 5 - .NetElgin Methley PrinceView Answer on Stackoverflow