This project is read-only.

Generic Deserialize method

Mar 27, 2012 at 10:21 PM

Pawel, hello.

Thank you for a such great product - it made my life easier :)

Do you have any plans to make Deserialize method generic? It would be very handy in situations, when one type exists in two different assemblies. For example we can meet this situation in RiaServices projects, serializing one of the proxy classes on client and deserializing it on server side with different assembly name. In current implementation of sharpSerializer we need to have both client sl assembly and server assembly to have the same name (or maybe to use typeconverter) - this is not always convenient. 

Thank you!

Apr 27, 2012 at 6:30 AM

hi, have you thought of deactivating serialization of types as AssemblyQualifiedName and serializing them in a simplified way?

http://www.sharpserializer.com/en/tutorial/index.html#a52

Jun 27, 2012 at 9:32 PM
polo wrote:

hi, have you thought of deactivating serialization of types as AssemblyQualifiedName and serializing them in a simplified way?

http://www.sharpserializer.com/en/tutorial/index.html#a52

I also have a similar requirement to be able to deserialize in a different assembly as i serialize in a windows 7 app and desrialize in a windows ce application, having followed the tutorial you reference I am still unable to deserialize unless i name the assemblies the same. I have tried putting my classes to serialize in a seperate namespace however to no joy.

i can provide sample code if it helps, can you advise of  a fix or work around?

Jun 27, 2012 at 11:26 PM

Hi, there is no assembly mapping nor assembly resolving in SharpSerializer. A sample solution could consist of three projects: Server, Client and Interface where Interface project contains all business objects to be serialized. Both the client and the server projects have reference to the interface project. Interface does not know the other both. Is it acceptable for you?

Jun 28, 2012 at 7:50 AM

Hi Polo,

In an every day windows environment it would be acceptable, and having to rename my assembly to the same name as the creating assembly is fine, as I have a split over Windows 7 / Windows XP and the client being on Windows CE.  I was just wondering if there was a way to make it completely generic.

The issue I was having with the Windows CE client was that it was unable to find the reference to the serializing object even though class definitions were exactly the same.

Thanks for your help, I'll continue with what I was doing.

 

Regards

Phil