couchbaselabs / Couchbase.Extensions

Extensions for Couchbase for .Net Core
Apache License 2.0
27 stars 14 forks source link

FormatException when DateTime stored with Extension method #21

Closed jeffrymorris closed 6 years ago

jeffrymorris commented 6 years ago
 _distributedCache.Set("theCacheKey", DateTime.Now, new DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(10)
            });

            var val = _distributedCache.Get("theCacheKey");

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

at System.Convert.FromBase64_Decode(Char startInputPtr, Int32 inputLength, Byte startDestPtr, Int32 destLength) at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) at System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length) at Newtonsoft.Json.JsonTextReader.ParseReadString(Char quote, ReadType readType) at Newtonsoft.Json.JsonTextReader.ParseString(Char quote, ReadType readType) at Newtonsoft.Json.JsonTextReader.ReadAsBytes() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) at Couchbase.Core.Serialization.DefaultSerializer.Deserialize[T](Byte[] buffer, Int32 offset, Int32 length) at Couchbase.Core.Transcoders.DefaultTranscoder.Decode[T](Byte[] buffer, Int32 offset, Int32 length, Flags flags, OperationCode opcode) at Couchbase.IO.Operations.OperationBase`1.GetValue()