for the past 2 hours i have tried to parse an xml to json. in an example project that i did i did it like that:
string xmlString = XDocument.Load("G00011071.xml").ToString();
XmlDocument xml = new XmlDocument();
xml.LoadXml(xmlString);
var json = Newtonsoft.Json.JsonConvert.SerializeObject(xml);
and it worked fine..
when i tried to integrate it in a project that i need to use it there i got an error:
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)
i tried to solve it, but nothing helped - so i decided not to use Json.net and looked for alternatives, i found that post:
but my XML structure is much more complex then the one used there..
How can i achieve the same result as the one Json.net produced?