Deserialize XML without namespaces but in a class expecting namespaces

前端 未结 4 1427
感动是毒
感动是毒 2021-01-02 10:55

Duplicate:
Omitting all xml namespaces when serializing an object? Not the same.. I want in the other way: Deserialize!


I

4条回答
  •  迷失自我
    2021-01-02 11:03

    You could read the file in as text, remove the offending namespace text, then deserialize it.

    You may need to write the "good" text back into a [memory/string/etc] stream so that the XmlSerializer's Deserialize can be called.

提交回复
热议问题