I'm trying to change the default views location so the following works:
[Route("")]
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
The location of where I want the views is /MVC/Views/ControllerName/Index(MethodName)
I've attempt by adding the following to Startup => ConfigureServices (IServiceCollection)
services.Configure<RazorViewEngineOptions>(o =>
{
o.AreaViewLocationFormats.Clear();
o.AreaViewLocationFormats.Add("/MVC/Views/{1}/{0}" + RazorViewEngine.ViewExtension);
});
The following works but I would prefer for it to default to the correct path
return View("/MVC/Views/Home/Index.cshtml");