How to connect user view in MVC 6 beta7?

in beta 6, we were able to enable custom viewing:

services.AddMvc() .AddViewOptions(options => { options.ViewEngines.Clear(); options.ViewEngines.Add(typeof(MyCustomViewEngine)); }); 

this no longer works in beta7 and options.ViewEngines seems to have changed to

 IList<IViewEngine> 

I don’t understand how to connect it without updating it and not providing its dependencies

 options.ViewEngines.Add(new it up here?); 

How can I enable my own custom view in beta?

+7
asp.net-core asp.net-core-mvc
source share
1 answer

I figured this out before calling

 services.AddMvc() 

I need to add my view in DI

 services.TryAddSingleton<IRazorViewEngine, MyCustomViewEngine>(); 
+6
source share

All Articles