我正在使用 Devart 来执行数据库对象和存储过程映射。
现在我想将存储过程对象结果存储在缓存中(使用 MemCached 的 Enyim)。
当我尝试这样做时,我遇到了这种错误(简而言之:Devart.Data.Linq 中的类型 Devart.Data.Linq.a 未签名为可序列化)
Enyim.Caching.MemcachedClient - System.Runtime.Serialization.SerializationException: Il tipo 'Devart.Data.Linq.a' nell'assembly 'Devart.Data.Linq, Version=2.50.29.0, Culture=neutral, PublicKeyToken=09af7300eec23701' non è contrassegnato come serializzabile.
in System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
in System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
in System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
in System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
in System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
in System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
in Enyim.Caching.Memcached.DefaultTranscoder.SerializeObject(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 219
in Enyim.Caching.Memcached.DefaultTranscoder.Serialize(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 65
in Enyim.Caching.Memcached.DefaultTranscoder.Enyim.Caching.Memcached.ITranscoder.Serialize(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 18
in Enyim.Caching.MemcachedClient.PerformStore(StoreMode mode, String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode) in d:\d\repo\EnyimMemcached\Enyim.Caching\MemcachedClient.cs:riga 313Enyim.Caching.MemcachedClient - System.Runtime.Serialization.SerializationException: Il tipo 'Devart.Data.Linq.a' nell'assembly 'Devart.Data.Linq, Version=2.50.29.0, Culture=neutral, PublicKeyToken=09af7300eec23701' non è contrassegnato come serializzabile.
in System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
in System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
in System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter)
in System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
in System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
in System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
in System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
in Enyim.Caching.Memcached.DefaultTranscoder.SerializeObject(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 219
in Enyim.Caching.Memcached.DefaultTranscoder.Serialize(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 65
in Enyim.Caching.Memcached.DefaultTranscoder.Enyim.Caching.Memcached.ITranscoder.Serialize(Object value) in d:\d\repo\EnyimMemcached\Enyim.Caching\Memcached\Transcoders\DefaultTranscoder.cs:riga 18
in Enyim.Caching.MemcachedClient.PerformStore(StoreMode mode, String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode) in d:\d\repo\EnyimMemcached\Enyim.Caching\MemcachedClient.cs:riga 313
这是 Enyim 日志。我确信 MemCached 配置正确,因为我尝试通过 telnet 获取和设置缓存中的对象,这已经完成。