[Mono-list] Deserialization issue when talking to webservicefrom mono

Robert Weiss rweiss at chesapeakebay.net
Wed Feb 11 14:23:59 EST 2009

Ok. I understand that answer and I have implemented a change similar to
what you responded.

However, I was under the assumption that mono was a supported project,
had access to the MS .NET Framework Source and was implementing it based
on that source.

Is this not the case? If it is the case, then this is a bug that needs
to be fixed to the correct implementation.

Thanks for the info.

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Robert Jordan
Sent: Wednesday, February 11, 2009 2:18 PM
To: Mono-list at lists.ximian.com
Subject: Re: [Mono-list] Deserialization issue when talking to
webservicefrom mono

Robert Weiss wrote:
> Yes. Assuming that your example class "Sample" was part of the .net
> framework and the implementation in .Net was what you listed and the
> mono implementation differs, then the binary serialization would not
> work. Since this *appears* to be the issue at hand with the way that
> Generic Sorted List was implemented in mono, how does one get the
> incorrect mono implementation fixed?

Mono's implementation isn't incorrect. It's just incompatible
regarding binary serialization.

Since SortedList<K, V> does not implement ISerializable, there
is no way to intercept the serialization process other than
trying to design the class layout like MS did. It's not an
easy process given that mono's developers never decompile
and look at MS' implementation.

Here's an exception I got while trying to deserialize
a stream created with MS.NET 2.x:

Unhandled Exception: System.TypeLoadException: Could not load type 
mscorlib, Version=, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, 
Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.

This means that MS' implementation is using an internal class
SortedList<K,V>.KeyList. No one knows exactly what this class is
for and how it's implemented...

You should replace the SortedList from your WebService API with
something that can be serialized better, like an array of pairs.

More on serialization: http://www.mono-project.com/FAQ:_Technical
(search for serialization).


Mono-list maillist  -  Mono-list at lists.ximian.com

More information about the Mono-list mailing list