InvalidOperation: The connection was not closed. The connections current state is connecting

Question: Why is this error showing up? the error says "InvalidOperation: The connection was not closed. The connections current state is connecting".


Please Login to see the rest of the answer

Answer: This error is thrown by Entity Framework (EF Core), if you see in the Stack Trace log, you can notice that the Microsoft.Data.ProviderBase.DbConnectionClosedConnecting.TryOpenConnection() function threw this exception.

In order to resolve the issue, just stop debugging the application and restart again. I hope this helps you, if it does please leave a comment below indicating how you solved the error. 


Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy