XML <> Json converters missing from Newonsoft.Json?

In my current project I (unfortunately) have a need to convert Json from an external web service into XML. It appears that the Newtonsoft Json library has functionality for that, such as JsonConvert.DeserializeXNode or the XNodeConverter class. Unfortunately, neither of those exist when I try and use them in my project. Is this a shortcoming of the PCL version of the Newtonsoft Json library, or am I missing something?

Trying to compile
JsonConvert.DeserializeXNode(httpString);
results in
Error CS0117 'JsonConvert' does not contain a definition for 'DeserializeXNode' MiosPCL C:\Users\Ronald\Source\Repos\HomeWave\HomeWave\HomeWave\MiosPCL\UserData.cs 95

Best Answer

Answers

  • kentuckerkentucker USMember ✭✭✭✭✭

    From the json.net docs

    The version of Json.NET being used in your application will change what XML conversion methods are available. SerializeXmlNode/DeserializeXmlNode are available when the framework supports XmlDocument; SerializeXNode/DeserializeXNode are available when the framework supports XDocument.

    PCL does not support XDocument

Sign In or Register to comment.