Json.net - windows store phone 8.1

Hi, I wanna use JSON.NET Library to seralize objects in Windows Store Application - SDK Phone 8.1 but I am getting error:

Assets/NewBehaviourScript.cs(3,7): error CS0246: The type or namespace name `Newtonsoft’
could not be found. Are you missing a using directive or an assembly reference?

I found in that topic that I had to copy json dll to assest folder because project get reloaded each time removing NuGet reference so I did it but now I got something like this:

Error building Player: Exception: Failed to run Reference Rewriter with cmdline --target=“Temp/StagingArea\Newtonsoft.Json.dll” --framework=“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhoneApp\v8.1” --platform=“C:\Program Files (x86)\Windows Phone Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd” --support=“Temp/StagingArea\WinRTLegacy.dll” --supportpartialns=Unity.Partial --system=System --dbg=pdb --alt=System.Xml.Serialization --ignore=System.IConvertible,mscorlib.[Temp/StagingArea\Newtonsoft.Json.dll]

Is there possible to use Json.net library or any other way to seralize object data in in windows store phone app?

Which DLL do you use? The .NET 2.0 assembly? The WinRT assembly looks strange, it has tons of referenced assemblies (26 to be more precise) which most likely don’t exist in your project. The .NET 2.0 assembliy only has 4 references (mscorlib, System, System.Data and System.Xml) which should work when those are available.

I never build a Windows Phone app, but i’m pretty sure you either use the wrong assembly, or this assembly isn’t comparible with the Mono version of Unity. Keep in mind that Unity doesn’t use .NET but Mono.

I checked every version and netcore45 from json.net package folder finally got compiled so we got solution. Thanks for help :slight_smile: