Search code examples
c#xamarinportable-class-library

Xamarin portable class library issue


Hi I have the following issue, I am using xamarin on a Mac and created a cross-platform app solution using native single view app with portable class library.

In the portable class library i added one reference to newtonsoft.json v4.0.3 but when i rebuild my project i get errors like the following:

  • Reference to type 'System.ComponentModel.ITypedList' claims it is defined assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found.

What should i do?

Thank you very much in advance


Solution

  • Version 4.0.3 of Newtonsoft.Json is only available for .NET (2.0, 3.5, 4.0), Windows Phone 7 (I think) and Silverlight 4. This version does not support portable class libraries.

    Use NuGet to download the latest Newtonsoft.Json version, it should provide a number of PCL alternatives, in particular a Profile 328 assembly that can target practically all modern platforms including Xamarin iOS and Android.