During development I've seen xml read errors like this more than once:
TestData.ReadFromXml: xml Deserialize error:There is an error in XML document (2, 2)..
What exactly does (2, 2) refer to? Is it line 2 in the xml file? Line 2, token 2, what?
Are there any debug options I can add to shed more light on the problem?
Edit: here are the first 2 lines:
<?xml version="1.0" encoding="utf-8"?>
<TestSession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
So it would be complaining on the 'T' character on the 2nd line? This is a class I just serialized, and it is well formed. When deserializing, I think it doesn't like something in the class... and that might explain why it stops at the T in TestSession. It would be nice if it told you what it didn't like.
It's (line, character) and begins at 1 (not 0 based).
You should examine the InnerException to get a more precise error message.
Looking at your example, it could be something like:
"<TestSession> was not expected."
You can also change the serialized name by applying XmlRootAttribute to your class.
It's line 2, character 2.
I recommend you open the XML file in Visual Studio and then look at the Errors window to see if it complains at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With