Name cannot begin with the ' ' character

后端 未结 9 1304
抹茶落季
抹茶落季 2021-01-01 08:57

I\'m parsing some XML in C#. I\'m getting it from a database, and so converting it to a MemoryStream before reading it with an XmlTextReader. The problem is that I get this

9条回答
  •  遥遥无期
    2021-01-01 09:23

    I was getting the same error reading an XML file.

    It turned out I had an errant < character in my file.

    I was commenting out certain child nodes and when erasing one of the comment tags, I left an extra < in the file. The error message came back "Name cannot begin with the '\r' character" and this question was the top google result for that exact search.

    
        <
        
        
    
    

提交回复
热议问题