Add view location

In ASP.NET Core MVC, here’s how to add a new default location to find views:

services.AddControllersWithViews().AddRazorOptions(options => 
    options.ViewLocationFormats.Add("/Views/SpecialPlace/{0}.cshtml"));

Leave a Reply

Your email address will not be published.