Xmlvalidatingreader is obsolete
Xml Validating Reader' is obsolete: 'Use Xml Reader created by Xml Reader.I seem to have come across this several times in the past week or two, so it's worth making a note. If you catch an Xml Schema Exception you first use the C# as operator to cast the reader to an IXml Line Info (just to be safe - in an exception handler you might not be sure where the reader came from), check for null, and then if you have an interface call Has Line Info to see if you got far enough along in the reading to have any line information.None set, this validating reader also ignores white space.Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. The xml String I am passing into the function is the raw xml which is referencing the XSD schema.
Xml Reader Settings settings = new Xml Reader Settings(); settings.
All nodes returned from the given Xml Reader are also returned from this validating reader, so there is no information loss in the process.
New nodes not returned from the underlying reader may be added by this reader (for example, default attributes and the children of an entity reference).
Create() method using appropriate Xml Reader Settings instead.
Create (new Xml Text Reader(file), settings); Check the MSDN documentation for Xml Validating Reader and you'll see in the [Obsolete Attribute] attribute this: "Use Xml Reader created by Xml Reader.