XmlSchemaValidationException.LineNumber and LinePosition are 0 when validating an Xml Schema with XDocument.Validate

You are not validating the textual representation of the Xml anymore but the object model. As a result there is no lines and positions because there is no file but XElement, XAttribute etc. objects in memory. Another helpful hint would be to ask yourself - what line and position should be returned if you modified (e.g. an elelment was added) the XDocument after it was loaded but before running validation? If you are not creating or modifying the Xml the fastest way would be to use XmlReader to validate your Xml document. As a bonus - if the input is a file or a stream - you should get line and position information in case of validation errors.