[Mono-list] BinaryFormatter Issue

Pedro Santos donbonifacio.general@gmail.com
Sat, 27 Nov 2004 09:50:00 +0000


On Sat, 2004-11-27 at 08:47 +0000, Pedro Santos wrote:
> Hello. I Use BinaryFormatter to serialize an Object and it runs just
> fine. However, when I desserialize it, I get the following exception:
> 
> "Serializable objects must be marked with the Serializable attribute"
> 
> Any help on this?

Well, using SoapFormatter I got a better expcetion Message and find out
I neglected to use [Serializable] in a nested class. Is this a bug?

However, now I have another problem. I get the following exception form
either IFormatter:

System.Runtime.Serialization.SerializationException: The constructor to
deserialize an object of type Chronos.Alliances.AllianceCollection was
not found.

And I have AllianceCollection like this:

[Serializable]
public class AllianceCollection : Hashtable {

        public AllianceCollection() {
                // ... some stuff
        }
};

Any help? If I create a ctor with the SerializationInfo and
StreamingContext I have other several problems. What's the best way to
serialize AllianceCollection?