I am using XML serialization to read a large user input file. If there is a semantic error in the input that is not discovered during reading, I'd like to be able to tell the user where (file, line, column) they can find the offending element. Is this possible with XML serialization?
CLARIFICATION: The code in question is an IoC container for Compact Framework; many of the possible semantic errors relate to things like reflection failures while initializing the final object graph. These are effectively run-time errors, not read-time or compile-time errors. However, I'd like to tell them not only that a property set failed because class Blah doesn't have property Fred, but that the property set in question is on line 1337 of Objects.xml.
- The errors do not result in deserialization exceptions. The input is valid for deserialization purposes and contains no syntax or data type errors.
- The errors cannot be detected by enabling schema validation. The input is schematically valid.
- The errors cannot be detected during the read/deserialization process because the types of target objects may not yet have been resolved.