At the time of this writing (Mar-10-2016) the official ASP.NET Documentation to "Creating a Custom View Engine" (Page 299) was not available.
I was getting the same error using "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", but because my intent was just include additional view locations, I fix it with:
public class CustomViewLocationExpander : IViewLocationExpander
{
public void PopulateValues(ViewLocationExpanderContext context)
{
}
public virtual IEnumerable<string> ExpandViewLocations(
ViewLocationExpanderContext context,
IEnumerable<string> viewLocations)
{
return viewLocations.Union(new string[] { "~/Views/{1}/PartialViews/{0}.cshtml" });
}
}
and adding the code to Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services
.AddMvc()
.AddRazorOptions(options =>
{
options.ViewLocationExpanders.Add(new CustomViewLocationExpander());
})
.AddViewLocalization(LanguageViewLocationExpanderFormat.SubFolder);
}
I hope that could help you in some way.