[Mono-list] About Serialization

Lluis Sanchez lluis@ideary.com
Tue, 18 Feb 2003 01:52:32 +0100


Fixed in CVS. It was a problem with ObjectManager.

BTW, as suggested by Patrik, it fails on MS.NET :-)

Lluis.

----- Original Message -----
From: <yoros@wanadoo.es>
To: "mono-list" <mono-list@ximian.com>
Sent: Monday, February 17, 2003 11:41 PM
Subject: [Mono-list] About Serialization


>
> Hello,
>
> I was testing some stuff with BinaryFormatter and saw that there is a
> problem when I serialize an array of structs of objects... something
> like this:
>
> [Serializable]
> public class A {
> string s;
> public A (string s) { this.s = s; }
> }
>
> [Serializable]
> public struct B {
> public A element;
> }
>
> public static void Main (string[] args) {
> B[] array = new B[10];
> for (int i = 0; i < 10; i++) {
> array[i].element = new A("string");
> }
> // now serialize the array, it fails when serializing the elements
> // of the array (the size and other properties are good).
> }
>
> Can anybody tell me where resides the core of the array serialization?
>
> I know that the problem is not with structs because if I serialize B it
> works perfectly.
>
>
> Regards,
>
>     Pedro
>
> --
> Pedro Martinez Juliá
> \  yoros@terra.es
> )|    yoros@wanadoo.es
> /        http://yoros.cjb.net
> Socio HispaLinux #311
> Usuario Linux #275438 - http://counter.li.org
> GnuPG public information:  pub  1024D/74F1D3AC
> Key fingerprint = 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>