PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework
Timeouts are not supported exception
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework
Timeouts are not supported exception
![]() |
Timeouts are not supported exception |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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(); } |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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(); > } > > > |
|
![]() |
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

