Home All Groups Group Topic Archive Search About

System.Web.Caching.Cache doesn't initialize _cacheInternal

Author
7 Nov 2006 10:15 PM
Tim Johnson
I'm trying to use the System.Web.Caching.Cache in a non-web, non-HTTPContext
environment.  When I do this:

System.Web.Caching.Cache webCache = new System.Web.Caching.Cache(); 
int n = webCache.Count;

I get a null-reference exception on the 2nd line.  In the debugger it shows
that the webCache's _cacheInternal private member is <undefined value>. 
Therefore I can't add, count, get, remove, etc.

Any idea why I couldn't use this class in this way?

AddThis Social Bookmark Button