My project is built on .Net Framework 4.0 and we are using built in ObjectCache
as MemoryCache
which is implemented in System.Runtime.Caching
.
It was working fine previously but suddenly it has stopped saving anything on the cache. When I call Set
method on cache it doesn't save anything and the Result View
is always empty, stating Enumeration yielded no results
. I double checked the code and found no catch there. It's really as simple as something like below:
var policy = new CacheItemPolicy();
cache = new MemoryCache("MyCache");
cache.Set("item", "item value", policy);
var item = cache.Get("item");
cache.Remove("item"); //when removal is required
However, a sample application targeting .Net Framework 4 on the same machine works. I was wondering if anyone else has experienced similar behavior and how could I get to the core of this issue? Is there any tool out there to help?