you have a couple things wrong here. roughly the fix would be to keep a
reference to the callback (which you are throwing away) like so
app_start event handler
onRemove = new CacheItemRemovedCallback(this.reload_Callback);
//later
then you call your insert
_cache.Insert("xmlDoc", xmlDoc,
new CacheDependency(_path),
Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration,
CacheItemPriority.Default,
new CacheItemRemovedCallback(reload_Callback));

Signature
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
> I'm trying to put a xml file in the Cache to be shared for the whole
> application. Whenever I change the xml file I need to refresh the Cache,
[quoted text clipped - 22 lines]
> LoadXML();
> }
Joe User - 30 May 2004 11:29 GMT
> you have a couple things wrong here. roughly the fix would be to keep a
> reference to the callback (which you are throwing away) like so
[quoted text clipped - 10 lines]
> CacheItemPriority.Default,
> new CacheItemRemovedCallback(reload_Callback));
You mean this?
_cache.Insert("xmlDoc", xmlDoc,
new CacheDependency(_path),
Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration,
CacheItemPriority.Default,
new CacheItemRemovedCallback(onRemove));