一、C#代码
string filePath = @"C:\PatList.xml";
var resp = XmlUtil.DeserializeFromFile<List<PatInfo>>(filePath);
二、报错的PatList.xml原结构
<?xml version="1.0" encoding="utf-8"?>
<PatList>
<PatInfo>
<lismain_repno>10246201611245007</lismain_repno>
</PatInfo>
<PatInfo>
<lismain_repno>102462016112418</lismain_repno>
</PatInfo>
</PatList>
三、修复后的结构
PatList → ArrayOfPatInfo
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPatInfo>
<PatInfo>
<lismain_repno>10246201611245007</lismain_repno>
</PatInfo>
<PatInfo>
<lismain_repno>102462016112418</lismain_repno>
</PatInfo>
</ArrayOfPatInfo>