public class FeatureFolderViewLocationExpander : IViewLocationExpander { public void PopulateValues(ViewLocationExpanderContext context) { /* no-op */ } public IEnumerable ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable viewLocations) { // {0} - Action Name // {1} - Controller Name // {2} - Area name object area; if (context.ActionContext.RouteData.Values.TryGetValue("area", out area)) { yield return "/Areas/{2}/{1}/{0}.cshtml"; yield return "/Areas/{2}/Shared/{0}.cshtml"; yield return "/Areas/Shared/{0}.cshtml"; } else { yield return "/Features/{1}/{0}.cshtml"; yield return "/Features/Shared/{0}.cshtml"; } } }