No service for type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory' has been registered

前端 未结 11 783
终归单人心
终归单人心 2021-01-01 08:57

I\'m having this problem: No service for type \'Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory\' has been registered. In asp.net core 1.0,

11条回答
  •  粉色の甜心
    2021-01-01 09:12

    Just add following code and it should work:

       public void ConfigureServices(IServiceCollection services)
            {
                services.AddMvcCore()
                        .AddViews();
    
            }
    

提交回复
热议问题