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

前端 未结 2 2181
梦谈多话
梦谈多话 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.

    0 讨论(0)
  • 2021-02-20 03:16

    Maybe You forgot to await async function, and then next statement is trying to execute two queries on single connection?

    0 讨论(0)
提交回复
热议问题