Having issue with multiple controllers of the same name in my project

The error message contains the recommended solution: “If this is the case, register this route by calling an overload of the ‘MapRoute’ method that takes a ‘namespaces’ parameter.” routes.MapRoute( “Default”, // Route name “{controller}/{action}/{id}”, // URL with parameters new { controller = “Home”, action = “Index”, id = UrlParameter.Optional }, // Parameter defaults new string[] … Read more

How to use an Area in ASP.NET Core

In order to include an Area in an ASP.NET Core app, first we need to include a conventional route in the Startup.cs file (It’s best to place it before any non-area route): In Startup.cs/Configure method: app.UseMvc(routes => { routes.MapRoute(“areaRoute”, “{area:exists}/{controller=Admin}/{action=Index}/{id?}”); routes.MapRoute( name: “default”, template: “{controller=Home}/{action=Index}/{id?}”); }); Then make a folder named Areas in the app … Read more