Page 1 of 1

Should Newtonsoft JSON.Net work?

Posted: Sat May 02, 2015 3:19 pm
by bdlou
I'm probably getting ahead of myself, but I wanted to throw together a simple app that pulls down a JSON source and displays the information from it. I brought in Newtonsoft JSON.Net but when I get to the DeserializeObject call it throws an exception:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization, Version=2.0.5.0

I assume that means the deployment process doesn't push over the binary dependency. So my question is, should it? Or is this type of thing even supported?

Re: Should Newtonsoft JSON.Net work?

Posted: Sat May 02, 2015 9:52 pm
by pwinwood
The list of unavailable APIs is listed here

http://ms-iot.github.io/content/win10/U ... leApis.htm

However I cannot see System.Runtime.Serialization listed there.
How did you add a reference to Newtonsoft.Json?
Did you use the Package Manager Console in Visual Studio 2015 to add it from nuget to get a compatible version?

Re: Should Newtonsoft JSON.Net work?

Posted: Sun May 03, 2015 12:10 pm
by bdlou
I did it through the UI. Manage NuGet Packages for Solution.

Re: Should Newtonsoft JSON.Net work?

Posted: Sun May 03, 2015 2:53 pm
by pauldy
It should work without issue you will just have to add ti as a dependency or if you want you can add it as an embedded resource and load it dynamically at application runtime.


But why not just use System.Web.Extensions? The System.Web.Script.Serialization.JavaScriptSerializer class is good enough for 90+% of what people do with Newtonsoft even though their charts make it look like no one does anything.

Re: Should Newtonsoft JSON.Net work?

Posted: Sun May 03, 2015 3:26 pm
by bdlou
Great suggestions. I'll investigate all those options. Thanks!

Re: Should Newtonsoft JSON.Net work?

Posted: Mon May 04, 2015 2:24 pm
by bdlou
Just to close the loop (sorta), this looks to actually be an issue with JSON.Net and UAP projects:
https://github.com/JamesNK/Newtonsoft.Json/issues/559