【发布时间】:2016-11-01 12:40:05
【问题描述】:
我有以下 json,它是从 XML 转换而来的。
{
"@number":"0",
"Field":[
{
"@key":"status",
"a":"1"
}
]
}
当我使用 JsonConvert.DeserializeXmlNode() 函数将其转换回 XML 时,它给了我以下异常。
System.InvalidCastException: Unable to cast object of type 'Newtonsoft.Json.Converters.XmlDocumentWrapper' to type 'Newtonsoft.Json.Converters.IXmlElement'.
我该怎么做?
【问题讨论】: