-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CacheManager core with couchdb throws error while trying to get an exsiting cache item #297
Comments
net4.6.1 is ok, net core not working ? |
After two days digging, found code bellow in NewtonSoft.Json. If an object is Serializable, it will serialize it use Another problem is: there isn't a ctor take a serializer param in CacheManager.Couchbase. So the serializer setting is ignored. |
there is two workaroud for this:
this problem can only happen after you stored data use one version(net452/netstandard2) and try to get/update data use another version |
Uh oh OK. I actually didn't know that Newtonsoft.Json handles the serializable interface/attribute like this. I knew it respects the properties added to the The fact that it doesn't handle casing properly sounds more like a bug though. CacheItem has that kind of implementation because the .Core package supports binary serialization in the full framework target. That path is not supported in netstandard because some types like Regarding the workarounds, I agree with you. And I also don't have a better solution. |
Hello,
I'm using Cachemanager core (v 1.2.0 ) with the following config
In my code below ,I use the cache instance to check for a key , if it doesn't exist it's then added to the cache , the _cache.Exists() and _cache.add() are working fine and the the item is added also in the couche db as a json doc (see joined file ) , but the Get function throws a nullReferenceException and I fail to figure out why.
Code snippet :
Exception :
{System.NullReferenceException: Object reference not set to an instance of an object. at CacheManager.Core.Internal.BaseCache
1.Get(String key)`couch data :
Thanks in advance
The text was updated successfully, but these errors were encountered: