Reputation: 433
My code is as follows.
using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream("TestStore1.xml", FileMode.Open, isoStore))
{
using (StreamReader reader = new StreamReader(isoStream))
{
str = reader.ReadToEnd();
XmlDocument doc = new XmlDocument();
doc.LoadXml(str);
string json = JsonConvert.SerializeXmlNode(doc);
}
}
It is giving the error at the line of string json = JsonConvert.SerializeXmlNode(doc);
Error - Newtonsoft.Json.JsonConvert' does not contain a definition for 'SerializeXmlNode'
Upvotes: 2
Views: 1054
Reputation: 1076
If you are using dotnet core, install the Newtonsoft.Json
package via nuget.
Upvotes: 1