过去2个小时我试图将xml解析为json。 在我做我做到了这样一个例子项目:我如何将XML转换为json(不使用Json.NET)
string xmlString = XDocument.Load("G00011071.xml").ToString();
XmlDocument xml = new XmlDocument();
xml.LoadXml(xmlString);
var json = Newtonsoft.Json.JsonConvert.SerializeObject(xml);
,它工作得很好..
当我试图把它的一个项目,我需要使用它有 我得到整合错误:
An exception of type 'System.IO.FileLoadException' occurred in xmloutput.dll but was not handled in user code. Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
我试图解决这个问题,但没有任何帮助 - 所以我决定不使用 Json.net和寻找替代品,我发现post:
,但我的XML结构复杂得多然后使用那里的一个..
我怎样才能达到同样的结果作为一个Json.net产生的?
你能上传你的xml文件吗? – ganchito55
我如何发布它,这里非常长..? –
http://pastebin.com/例如 – ganchito55