“Context cannot be used while the model is being created” exception with ASP.NET Identity

后端 未结 7 1101
遥遥无期
遥遥无期 2020-12-01 07:42

Why is this happening when we make a call to the AccountApiController.Register() method?

  • what is trying to use the context?
  • what is trying to create
相关标签:
7条回答
  • 2020-12-01 08:05

    I agree with the main Answer by Shaun Luttin but also,

    In my case: after the deployment i take this error and i found the reason is using the Hsts Preload after inserting SSL certificate. Uncommenting this lines solved the redirection, and it solved this error completely

     //app.UseHsts(options => options.MaxAge(days: 18 * 7).IncludeSubdomains().Preload());
    
    0 讨论(0)
提交回复
热议问题