Last post Jan 27, 2020 01:39 AM by ProgMaster
Jan 27, 2020 12:38 AM|ProgMaster|LINK
When I created a Web API project in Visual Studio 2019, I noticed that along with an MVC Home controller a Web API controller is also created automatically for me. The problem is that when I set the Home/Index page as the starting page and click the play
button, it threw an error. The error I got was "The resource cannot be found." I noticed that the path in the address bar is "http://localhost:53399/Views/Home/Index.cshtml".
However, when I right click on Index.cshtml in the Home folder and select Show in Browser, the path I see in the address bar is "http://localhost:53399/Home/Index" and the page is rendered just fine. My question
are is this the correct behavior and am I not suppose to click the play button to display the pages?
Jan 27, 2020 01:39 AM|ProgMaster|LINK
I know that MVC uses the default route in global.asax files for navigating from view to view and other posted articles on this very error. The problem is the method for fixing this issue isn't applicable to visual studio 2019 so I decided to delete the project
and create it again.