how to solve newston.json version error

209 views Asked by At

Actually i am developing my app with xamarin studio for Android and IOS for webService i had included a seperate project in Android and IOS each.

My webService response is in xml form so i converted it in to json by following:

XmlDocument doc = new XmlDocument ();
doc.LoadXml (json);
var jsonText = JsonConvert.SerializeXmlNode (doc);

using Newtonsoft.Json version 4.5

working in Android.

Shifted to IOS used the same webService c# coding in IOS but it shows me below error:

Could not load type 'Newtonsoft.Json.Utilities.DynamicWrapper' from assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

SignalR & WebApi - colliding Newtonsoft.Json references

Tried with the above links but no use if any one have idea please help me out to solve this issue.

1

There are 1 answers

4
staticvoidmain On

This is the common error people face with newtonsoft.json while .net project migrations. I have faced this error too. I did the below steps.

I use visual studio and I

1) removed the reference from the .csproj file and the corresponding dll,
2) uninstalled and installed the package again.

The problem is that nuget package restore updates the package in the dll level but not at the .csproj level.

Hope this helps.