.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
Post a Comment