Reputation: 2032
How can the XML
contained in an XmlReader
instance be written to the immediate window in Visual Studio? Seems like ToString()
would do the trick, but it doesn't...
Upvotes: 1
Views: 1106
Reputation: 4520
Try this:
reader.MoveToContent();
reader.ReadOuterXml();
But be aware that the XmlReader will not be usable any more.
Upvotes: 2
Reputation: 100298
Do you want to debug XmlReader? From my experience it's easier to give up.
Dispite that you can call XDocument.Load(reader).ToString()
what will read the reader to its end thus make it further unusable. However you can initialize a new reader from resulting document. To make it easier write a helper method.
Upvotes: 2