Before I changed the default page of my project, when I would run it, its url was same:
http://localhost:54465
and it loaded default home page.
after I set “Index” as default page, its url changed to:
http://localhost:54465/Views/Home/Index.cshtml
it shows this error:
“The resource cannot be found.”
and doesn’t show home page.
How can I change it to the default setting?
Don’t set
.cshtmlviews as Default Page. In ASP.NET MVC Views cannot be served directly. Requests go through the routing engine which resolves controllers and actions. It is those actions that are returning views. So if you want to set a default action you could configure it in the properties of the ASP.NET MVC Project by specifying the URL to launch when running the project. It is situated in theWebtab: