XML : Print the whole line with errors

I'm using XmlReader, and at some point it throws an exception:

Exception thrown: 'System.Xml.XmlException' in System.Xml.dll
Additional information: An error occurred while parsing EntityName. Line 15463920, position 47.

I want to be able to show the contents of line 15463920 when this happens, but I can't seem to find a way to do it without loading the whole XML file into memory. Any solution?

No comments:

Post a Comment