我正在使用 Couchbase 来存储和管理我的数据。
当我尝试使用从缓存中获取实体时
CacheClient.GetWithCas<T>(cacheKey)
我收到了这个错误:
Unable to load type X required for deserialization.
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at Enyim.Caching.Memcached.DefaultTranscoder.DeserializeObject(ArraySegment`1 value)
at Enyim.Caching.Memcached.DefaultTranscoder.Deserialize(CacheItem item)
at Enyim.Caching.Memcached.DefaultTranscoder.Enyim.Caching.Memcached.ITranscoder.Deserialize(CacheItem item)
at Couchbase.CouchbaseClient.PerformTryGet(String key, UInt64& cas, Object& value)
at Enyim.Caching.MemcachedClient.GetWithCas[T](String key)
我想这可能是因为我更改了类型(删除属性或更改了它们的签名)。
你能帮我弄清楚如何避免这种情况发生吗?