UserManager Error - A second operation started on this context before a previous asynchronous operation completed

前端 未结 2 2153
梦谈多话
梦谈多话 2021-02-20 02:40

I am facing this issue with my asp.net MVC5 web application, using Identity v2.0.0.0, EF 6, Castle Windsor IOC Container, Microsoft SQL Server 2005

I am trying to get th

2条回答
  •  自闭症患者
    2021-02-20 03:01

    It sounds like you are creating two contexts, both of which are of the same type of ApplicationDbContext. When EF detects two calls happening at the same time to the same context you get your error.

    You will either have to create only one instance of your context per web request or split your context into it's component parts so both can be injected without a conflict.

提交回复
热议问题