简体   繁体   中英

.Net - Redis cache “object disposed exception”

While debugging and locally testing my application, every now and then I get a "SocketManger.cs" not found associated with a System.ObjectDisposedException . I only get this because on the exceptions settings panel I fully-checked the Common Language Runtime Exceptions .

I can't get to the bottom of this problem because i keep pressing F10 , hoping that one moment, the debugger will take me to the invocation of the read/write operation that is trying to execute on a disposed object. But the moment never comes... I can see in the Call Stack window that i'm going up on the stack, reaching [External Code] but I just can't get back to MY CODE...

Since this problem happens regularly, i need to get this done, because this is corrupting my cache or not returning a item that is already cached, forcing my app to duplicate work...

How can i get to the bottom of this problem?

Why would you get an ObjectDisposedException? Are you disposing the underlying connection while requests might be going on? Are you doing something like this ( https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#reconnecting-with-lazyt-pattern ) where you will need to handle the ObjectDisposedException? YOu should be able to retry in that case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM