Timeouts are not supported exception

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();
}
 
B

Bob

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]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top