I\'m having this problem: No service for type \'Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory\' has been registered. In asp.net core 1.0,
If you're using 2.x then use services.AddMvcCore().AddRazorViewEngine(); in your ConfigureServices
2.x
services.AddMvcCore().AddRazorViewEngine();
ConfigureServices
Also remember to add .AddAuthorization() if you're using Authorize attribute, otherwise it won't work.
.AddAuthorization()
Authorize
Update: for 3.1 onwards use services.AddControllersWithViews();
3.1
services.AddControllersWithViews();