[Mono-list] About Serialization

Torstensson, Patrik patrik.torstensson@intel.com
Mon, 17 Feb 2003 14:46:55 -0800


Can you test the code on MS platform also? I had a lot of issues with =
serialization on MS platform to..


-----Original Message-----
From: yoros@wanadoo.es [mailto:yoros@wanadoo.es]=20
Sent: Monday, February 17, 2003 11:42 PM
To: mono-list
Subject: [Mono-list] About Serialization


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:

public class A {
	string s;
	public A (string s) { this.s =3D s; }

public struct B {
	public A element;

public static void Main (string[] args) {
	B[] array =3D new B[10];
	for (int i =3D 0; i < 10; i++) {
		array[i].element =3D 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.



Pedro Martinez Juli=E1
\  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 =3D 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC
Mono-list maillist  -  Mono-list@lists.ximian.com