.net - System.Runtime.Caching.MemoryCache strange behavior? -


have question on msdn forums (http://social.msdn.microsoft.com/forums/en-us/netfxbcl/thread/0a666d5e-9bda-47bd-8dd3-98d32eb5fe60/?prof=required), thought i'd opinion of folks here :

here's output of immediate window :

(employeecache memorycache).add("test", new object(),datetimeoffset.now.addminutes(10)); true (employeecache  memorycache).getcount() 0 (employeecache  memorycache) {<namespace>.customcache} [<namespace>.customcache]: {[<namespace>.customcache} base {system.runtime.caching.objectcache}: {<namespace>.customcache} cachememorylimit: 1887436800 defaultcachecapabilities: inmemoryprovider | cacheentrychangemonitors | absoluteexpirations |   slidingexpirations | cacheentryupdatecallback | cacheentryremovedcallback name: "keyname" physicalmemorylimit: 99 pollinginterval: {00:02:00} 

under conditions adding memorycache return true, object not cached? (the call getcount , 1 following made immediatley after adding cache)

the easiest way situation add on memorycache object dispose has been called. can check using visual studio debugger see private _disposed property of memorycache object. hover on variable references cache, use quick watch, or use immediate window.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -