Unable to enable service for type "Microsoft.AspNetCore.Session.ISessionStore" when trying to activate "Microsoft.AspNetCore.Session.SessionMiddleware"
If you get this error message in ASP.NET Core, you need to configure session services in Startup.cs:
public void ConfigureServices(IServiceCollection services) { services.AddMvc() .AddSessionStateTempDataProvider(); services.AddSession(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseSession(); app.UseMvcWithDefaultRoute(); }
source share