0

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.

Community
  • 1
  • 1
Manoj
  • 3,947
  • 9
  • 46
  • 84

1 Answers1

1

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.

staticvoidmain
  • 793
  • 6
  • 14
  • actually i am working in xamarin studio where could i find the .csproj file – Manoj Jun 22 '15 at 16:34
  • tried with the above but remains the same can you please help me out with any other solution. – Manoj Jun 23 '15 at 05:56
  • Okay. The reason behind this error is the `dll` version and the version used in the old application are different. Could you please uninstall and re-install the nuget packages? In the packages.config could you please check for the correct version of newtonsoft.json. It causes errors commonly for all on migrations. – staticvoidmain Jun 23 '15 at 06:44
  • @Manoj- Did you happen to fix the issue? – staticvoidmain Jun 24 '15 at 13:57