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

2019-01-31 05:01发布

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.

4条回答
Emotional °昔
2楼-- · 2019-01-31 05:40

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

alt text

查看更多
可以哭但决不认输i
3楼-- · 2019-01-31 05:41

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.

查看更多
Deceive 欺骗
4楼-- · 2019-01-31 05:43

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.

查看更多
太酷不给撩
5楼-- · 2019-01-31 05:57

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

查看更多
登录 后发表回答