Timeouts are not supported exception

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I am trying to xml serialize an object but when I pass in a memory stream I
get an exception saying that "Timeouts are not supported by this stream."
Why are timeouts required? This happens when I compile with VS2k5 .Net 2.0.
It seems to work with .Net 2k3.

public void Serialize(Stream stream)
{
XmlSerializer serializer = new
XmlSerializer(typeof(MyObject));
XmlTextWriter writer = new
XmlTextWriter(stream,System.Text.Encoding.GetEncoding(1252));
serializer.Serialize(writer,this);
writer.Flush();
}
 
After more investigation it appears there was a FileStream object as a
member on the object I was trying to serialize. This is where the error was
coming from not the memory stream I was passing in. Removing the FileSteam
got it to work. Sometimes error messages can be so vague.


"Bob" wrote in message news:[email protected]...
 
Back
Top