'No database provider has been configured for this DbContext' on SignInManager.PasswordSignInAsync

后端 未结 4 864
孤城傲影
孤城傲影 2020-12-08 18:11

.Net Core 1.0.0 - SDK Preview 2 (x64)

.Net Core 1.0.0 - VS "15" Preview 2 (x64)

.Net Core 1.0.0 - Runtime (x64)

So,

4条回答
  •  无人及你
    2020-12-08 18:36

    If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.

    The error message says your DbContext(LogManagerContext ) needs a constructor which accepts a DbContextOptions. But i couldn't find such a constructor in your DbContext. So adding below constructor probably solves your problem.

        public LogManagerContext(DbContextOptions options) : base(options)
        {
        }
    

    Edit for comment

    If you don't register IHttpContextAccessor explicitly, use below code:

    services.AddSingleton(); 
    

提交回复
热议问题