When I start using the open source version of NCache, I use the NCache API to store the value of an object. During POC, when I add an object to NCache, it always throws an "Object reference not set to an object instance". error message. And I'm sure the object is not null. The following is sample code:
Cache cache = null;
try {
cache = NCache.InitializeCache("mycache");
} catch (Exception ex) {
}
response = ....
CacheItem cacheItem = new CacheItem(response);
cache.Add("testNCache", cacheItem);
source
share