Without controller project doesn't work?

Hello, say I created an empty mvc project, if not all 3 files for the model and controller and view, the project will not work? And will give some error?
July 2nd 19 at 18:08
2 answers
July 2nd 19 at 18:10
Solution
Without controller c implemented action and view will not. You will see the error "Resource can not be found" in the browser window.

By default in the file routing project App_Start/RouteConfig.cs mapitse default-route, which is represented in the form:
routes.MapRoute(
 name: "Default",
 url: "{controller}/{action}/{id}",
 defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
 );


When is the request(e.g. the initial load of the main page) URL pattern ASP.NET parses the address that the request came and tries to find a file controller with the obtained value ControllerName, then it has already sought Action c obtained ActionName(other parameters can be optional).

In case of downloading of the main page with the default RouteConfig will be searched controller HomeController and action Index.

If the request YourHostName/Account/Register will go searching AccountController and in Register action in it.

Read more:
https://www.asp.net/mvc/overview/controllers-and-r...
Thank you very much helped - leonel.Shields commented on July 2nd 19 at 18:13
July 2nd 19 at 18:12
Solution
Well, if you do not set ranting with default values for controller and action, the project will start normally and it will work. That is, the controller is not required, respectively, and the model and view too.

* This is valid for dotnetcore. For mvc5 and older not sure... but should be the same

Find more questions by tags ASP.NET