开发者

Why is my cache item not nulled after Cache.Remove call?

I'm trying to remove a specific item from the ASP.NET Cache in order to force a reload. Something like 开发者_JAVA百科this:

System.Web.HttpContext.Current.Cache.Remove(SomeKey);

But then I check it immediately afterward, and Cache[SomeKey] is NOT null. It still contains a reference to this item I want to clear. Am I missing something obvious here?


OK, I figured it out... turns out I had a property in my Watch debug window, which had a side effect of priming the cache. So even though I was looking at the Cache object it was actually being instantly updated with a new value every time it was cleared. Embarrassing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜