I am attempting to deserialize only part of an xml, like in this post - How to deserialize only part of an XML document in C#.
This works, I get an object back!
But, with a validation error of type "... element is not declared".
Sketchy structre of my xml:
<UploadDocument>
<Document>
<!-- Inner xml removed-->
</Document>
</UploadDocument>
And the error message is - Document element is not declared.
If I attempt to deserialize the root element - UploadDocument - it just works with no validation errors.
My observation: When the schema is compiled, the Elements collection has only the root element - UploadDocument.