Type Reason InvalidOperationException The current instance was constructed with a System.Xml.XmlParserContext.
In the dnprdnext release, the recommended practice is to create System.Xml.XmlReader instances using the erload:System.Xml.XmlReader.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers.
This method enables you to parse multiple XML documents in a single stream. When you reach the end of an XML document, you can call ResetState to reset the state of the reader in preparation for the next XML document.
The documents in the stream must share the same encoding. If this is not the case, when ResetState is called an System.Xml.XmlException is thrown. (This is a change in behavior from .NET Framework version 1.1 and earlier).
The following properties are not affected by ResetState.