Page 1 of 1

Serialize objects for use with memcache

Posted: Mon 29 Aug 2011 17:23
by alfmos
Hi,
I want use memcache in a site. to use it I need to serialize objects.
I serialized domain objects, but I have this error now:

Enyim.Caching.MemcachedClient - System.Runtime.Serialization.SerializationException: The type 'Devart.Data.Linq.a' in assembly 'Devart.Data.Linq, Version=2.50.29.0, Culture=neutral, PublicKeyToken=09af7300eec23701' is not marked as serializable.

With this object I can't serialize my objects.
How can I make internal types of devart serializable?

thanks to all

Posted: Wed 31 Aug 2011 15:27
by StanislavK
According to the stack trace, Enyim.Caching.MemcachedClient uses BinaryFormatter to serialize objects. LinqConnect entities are not designed to be serialized via BinaryFormatter, DataContractSerializer should be used instead. For more information about this way of serialization, please refer to the following article:
http://msdn.microsoft.com/en-us/library ... aspx#Y1680
(it is writted about LINQ to SQL, but can be applied to LinqConnect as well).