I have no idea why this error is occurring after debugging the project even though the codes are default.
Controller
public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { return View(); } } View
@{ Layout = null; } <!DOCTYPE html> <html> <head> <title>Index</title> </head> <body> <div> Hi </div> </body> Somehow or rather, after debugging, the Requested URL is always /Views/Home/Index.cshtml but accessing Home via browser is fine. (http://localhost:58323/home)
I googled and solution hints that the problem lies in global. But thats weird, I dont remember making any changes to it.
Global
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } Appreciate any help. Thank you