PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Timeouts are not supported exception



Reply

Timeouts are not supported exception

 
Thread Tools Rate Thread
Old 10-01-2006, 04:19 PM   #1
Bob
Guest
 
Posts: n/a
Default Timeouts are not supported exception

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



  Reply With Quote
Old 10-01-2006, 05:45 PM   #2
Bob
Guest
 
Posts: n/a
Default Re: Timeouts are not supported exception

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:eDWbvGgFGHA.3928@TK2MSFTNGP10.phx.gbl...
>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();
> }
>
>
>



  Reply With Quote
Reply


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off