You receive an unhandled exception error message when you use the MemoryStream class in the .NET Framework 1.1 Service Pack 1 (888226)
The information in this article applies to:
- Microsoft .NET Framework 1.1 Service Pack 1 (SP1)
SYMPTOMSWhen you try to use the MemoryStream class to read a memory stream in a Microsoft Visual C# .NET 2003 project, you may receive an error message that is similar to one of the following: Unhandled Exception: System.Xml.XmlException: The root element is missing.
Unhandled Exception: System.IO.SomeStreamException: The memory stream is at the end of the buffer. Unhandled Exception: System.IO.SomeReaderException: The reader cannot read anymore. CAUSEThis behavior occurs if the following conditions are true: - You install the Microsoft .NET Framework 1.1 Service Pack 1 (SP1).
- The memory stream is positioned at the end-of-stream.
WORKAROUNDTo work around this behavior, reset the stream position before you create the XmlTextReader class. For an example, see the "More Information" section.
Modification Type: | Major | Last Reviewed: | 11/24/2004 |
---|
Keywords: | kbAppDev kbProgramming kbtshoot kbprb KB888226 kbAudDeveloper |
---|
|