阅读背景:

记一次EF Core DBContext在Action委托中GC异常的问题.

来源:互联网 

今天在开发过程中发现.在SaveChanges的时候偶尔会抛出异常:Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.今天在开发过程中发现.在SaveChanges的时候偶尔会抛出异常:Cannot access




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: