HttpContext.Current is null when CacheItemRemovedCallback is raised

I have code in global.asax that sets some things in cache with CacheItemRemovedCallback.

When an item is removed from the cache, the method in the CacheItemRemovedCallback is promoted.

The problem is that it cannot update the item in the cache because HttpContext.Current is NULL (therefore, the cache is unavailable).

Is there a workaround for this, or am I doing this completely wrong?

Framework 3.5

+4
source share
1 answer

You can access the cache from the HttpRuntime type: -

HttpRuntime.Cache.Add( ... ); 
+7
source

All Articles