Nuget schema version incompatible

Since pulling the latest version of our cross-platform code I'm unable to build the iOS code in Xamarin Studio. The nuget package restore stage gets the following error:
The schema version of 'Newtonsoft.Json' is incompatible with version 2.2.31210.9045 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942

The package is referenced in a PCL project and has presumably been updated on Windows.

I've tried deleting the Mac's nuget cache at '~/.local/share/NuGet/Cache' but that didn't help.

How do I upgrade nuget in mono/OS X?

Xamarin Studio Version 6.0.2 (build 73)
Xamarin.iOS Version: 9.8.2.22 (Xamarin Studio Community)

Thanks,

Paul

Answers

  • pauldpauld USMember ✭✭

    Ok, a quick workaround for now is to remove Newtonsoft.Json 9.0.1 from this particular project and add version 5.0.8. I noticed that 9.0.1 supports different frameworks/profiles. Do I need to update my PCL package somehow?

    removed: <package id="Newtonsoft.Json" version="9.0.1" targetFramework="portable40-net40+sl5+win8+wp8" /> added: <package id="Newtonsoft.Json" version="5.0.8" targetFramework="portable-net40+sl50+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+xamarinios10" />

  • mattwardmattward GBMember Xamurai

    I cannot reproduce this Xamarin Studio 6.0.2. Restore works OK with Newtonsoft.Json 9.0.1 in a PCL project. Also NuGet version 2.2.31210.9045 is not shipped with any version of Xamarin Studio so I do not see how that version is being used.

  • pauldpauld USMember ✭✭

    The problem went away, but has now come back again.
    I don't know how we have an odd version of Nuget, but that's what it's saying:

    Executing: mono --runtime=v4.0.30319 /Users/pdonovan/Work/myproj/.nuget/nuget.exe install "packages.config" -source "" -o "/Users/pdonovan/Work/myproj/packages" The schema version of 'Newtonsoft.Json' is incompatible with version 2.2.31210.9045 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942. /Users/pdonovan/Work/myproj/.nuget/nuget.targets: error : Command 'mono --runtime=v4.0.30319 /Users/pdonovan/Work/myproj/.nuget/nuget.exe install "packages.config" -source "" -o "/Users/pdonovan/Work/myproj/packages"' exited with code: 1.

    How can I track down why it thinks it's using that version? Are there any other files I can look at?

  • mattwardmattward GBMember Xamurai

    I would look at the assembly version of your myproj/.nuget/nuget.exe using something like:

    monodis --assembly nuget.exe | grep Version
    
Sign In or Register to comment.