abp Cannot access a disposed object. A common cause of this error is disposing


框架:abp

異常信息:

An unhandled exception was thrown by the application.
System.ObjectDisposedException: 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.

 之前以為:

遇到這種情況一般是異步、同步混着調用了。

檢查一下調用的地方是否為同步,但在實現函數里用異步得寫法了。

 

昨天在使用hangfre的時候又重現了。。。。經過不斷地google發現了一個帖子,解決了我的問題。之前的看法是錯誤的。

https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3544

以后出問題了還是多去官方git上看看issue。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server Syntax Error: ValidationError: Invalid options object. Stylus Loader has been initialized using an Linux系統-"cannot access Input/output error" Mysql Cannot get a connection, pool error Timeout waiting for idle object Invalid `Podfile` file: undefined method `pod' for main:Object. Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 281; 元素類型為 "sqlMapConfig" 的內容不完整 vue運行報錯error:Cannot assign to read only property 'exports' of object '#' Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed. selenium.common.exceptions.WebDriverException: Message: u'unknown error: cannot get automation extension\nfrom unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfeb error while loading shared libraries: libOpenGL.so.0: cannot open shared object file: No such file or directory
 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM