Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 8 JSON

I am starting the development on windows phone 8, the famous JSON.NET does not support windows phone 8 yet, is there any other library which can be used for this purpose?

like image 260
TilalHusain Avatar asked Nov 06 '12 15:11

TilalHusain


3 Answers

The JSON.NET codeplex site says that WP8 is supported.

Update: The JSON.NET NuGet package should just work with a Windows Phone 8.0 project. Adding it in VS2012 NuGet manager pulls in the WP7 version of JSON.NET. (packages\Newtonsoft.Json.4.5.10\lib\sl3-wp\Newtonsoft.Json.dll)

JSON.NET is now also available as a Portable Class Library which you can consume from WP8 (available in NuGet or in source form).

like image 137
Paul Annetts Avatar answered Nov 10 '22 23:11

Paul Annetts


Had the exact same problem - turns out I didn't have the newest version of NuGet.

To upgrade, click tools -> extensions and updates and then click the Updates-tab. Update everything, restart the program and try again. :-)

like image 38
Kris Selbekk Avatar answered Nov 11 '22 01:11

Kris Selbekk


I was having this issue. I was able to compile the source for Windows Phone 8 instead of Windows 7.1 and it worked. NuGet would not work for me.

Here is how I did it:

  1. Open up solution JsonXXrXX.zip\Source\Src\Newtonsoft.JSON.WindowsPhone.sln
  2. Go to properties for Newtonsoft.Json.WindowsPhone Project(Right click on the project then properties)
  3. For the dropdown of "Target Windows Phone OS Version" select Windows 8.X
  4. Compile.
  5. Grab the DLL, PDB, and XML from the output directory
  6. Add Reference to the DLL file in your Windows Phone 8 Project

Thats it. I can't vouch that it works 100% or that you'll be able to submit your app. But it should hold you over until there is official support.

like image 26
mfperzel Avatar answered Nov 10 '22 23:11

mfperzel