ASP.NET MVC 6 AspNet.Session Errors – Unable to resolve service for type?

Unable to resolve service for type ‘Microsoft.AspNetCore.Session.ISessionStore’ while attempting to activate ‘Microsoft.AspNetCore.Session.SessionMiddleware’

If you get this error message in ASP.NET Core, you need to configure the 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();
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)