I've added the reference to System.Runtime.Serialization dll to my project but still can't find the System.Runtime.Serialization.Json namespace and hence can't find the DataContractJsonSerializer class. What am I missing here?
4 Answers
Try in System.ServiceModel.Web.dll
5 Comments
Kayes
Thanks man. But I thought it was in System.Runtime.Serialization!
System.Runtime.Serialization.dll, System.ServiceModel.dll and System.ServiceModel.Web.dll forums.silverlight.net/post/47045.aspx
Chris Moschini
This namespace seems even more scattered; this walkthrough states you can get part of the namespace only by installing a specific Nuget package: amazedsaint.com/2011/02/aspnet-mvc-dynamic-json-jquery.html
Marc Gravell
@ChrisMoschini that package doesn't seem to exist any more, but it is likely all it contained was some framework dependencies / reference-instructions (no actual dlls), to add the above reference (and some others)
Chris Moschini
Looked further into it: most of it was also migrated to Newtonsoft.Json / Json.Net (look for Newtonsoft on Nuget).
I think this library is now deprecated in favour of Json.NET. JsonObject is a JObject and uses Json.NET library.