?
=?iso-8859-2?Q?S=B3awomir_Krzy=BFanowski?=
When I execute this code everything works fine, no exception is throwed.
Method GetObjectData was not entered, but object was serialized and file
cos.xml was created with correct data. When I use BinaryFormater then
Exception(" That metod... is throwed. I don't know why GetObjectData is not
executed with XmlSerializer.
FileStream stream = new FileStream(@"d:\cos.xml", FileMode.Open,
FileAccess.ReadWrite);
XmlSerializerFactory serializerFactory = new XmlSerializerFactory();
XmlSerializer serializer =
serializerFactory.CreateSerializer(typeof(Program));
serializer.Serialize(stream, new Program());
public class Program : ISerializable
{
public Int16 age;
public void GetObjectData(SerializationInfo info, StreamingContext
context)
{
throw new Exception("The method or operation is not
implemented.");
}
}
Method GetObjectData was not entered, but object was serialized and file
cos.xml was created with correct data. When I use BinaryFormater then
Exception(" That metod... is throwed. I don't know why GetObjectData is not
executed with XmlSerializer.
FileStream stream = new FileStream(@"d:\cos.xml", FileMode.Open,
FileAccess.ReadWrite);
XmlSerializerFactory serializerFactory = new XmlSerializerFactory();
XmlSerializer serializer =
serializerFactory.CreateSerializer(typeof(Program));
serializer.Serialize(stream, new Program());
public class Program : ISerializable
{
public Int16 age;
public void GetObjectData(SerializationInfo info, StreamingContext
context)
{
throw new Exception("The method or operation is not
implemented.");
}
}