[Mono-dev] Patch for some obscure cases in Dictionary (small)
Juraj Skripsky
js at hotfeet.ch
Mon Jun 23 06:16:34 EDT 2008
Hi Lionel,
I'm not sure whether the current implementation of Dictionary is
supposed to be binary compatible with .Net. Could you file a bug report
for case 2, along with a small test program that generates the .bin
file?
I'm not very familiar with the serialization features of .net, but I
think using SoapFormatter instead of BinaryFormatter will give you
results with much more information.
- Juraj
On Tue, 2008-06-17 at 18:49 +0200, Lionel Cuir wrote:
> Hello gentlemen,
>
> Since you're working on the Dictionary class, maybe you could help me
> debugging this.
> I have seen recent posts and patch to make the Dictionary more binary
> compatible between Mono and .Net (ie serialized data being compatible
> for serialization on one platform and deserialization on the other).
>
> I've done a couple of tests and what surprises me is that the binary
> form looks different in many cases but can still be deserialized by the
> other platform... in most cases only (see the example below).
>
> => What's the status for the Dictionary class. Are Mono and .Net
> officially binary compatible for the Dictionary or not yet?
>
> Examples:
> - Case 1: I have a Dictionary<long, DateTime>. Even if different, the
> binary serialized forms can be deserialized by the other platform (!).
> (see dico1_dotnet.bin and dico1_mono.bin).
> - Case 2: I have a Dictionary<long, Triplet<long, ManagementState,
> DateTime>> where Triplet is a simple triplet struct (see below) and
> ManagementState a basic enum.
> Here, neither Mono not .Net is able to deserialize a dico serialzed by
> the other (see dico2_dotnet.bin and dico2_mono.bin).
>
> Thanks for your advice!
> Lionel
>
> Here's the Triplet struct:
> [Serializable]
> public struct Triplet<TX, TY, TZ>
> {
> TX _X;
> TY _Y;
> TZ _Z;
>
> public Triplet(TX x, TY y, TZ z)
> {
> this._X = x;
> this._Y = y;
> this._Z = z;
> }
>
> public TX X
> {
> [DebuggerStepThrough]
> get { return _X; }
> }
> public TY Y
> {
> [DebuggerStepThrough]
> get { return _Y; }
> }
> public TZ Z
> {
> [DebuggerStepThrough]
> get { return _Z; }
> }
> }
>
More information about the Mono-devel-list
mailing list