System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependecy injection and then later trying to use the same context instance elsewhere in your application. 

Question: How do you solve: "System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependecy injection and then later trying to use the same context instance elsewhere in your application. 

This may occur if you a are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using depedency injection, you should let the dependecy injection container take care of disposing context instances.

Object name: NameOfObject.


Edit this Article
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

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

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy