I am working on a demo Silverlight app and I'd like to do some simple JSON. I found the System.Runtime.Serialization.Json.DataContractJsonSerializer
class on MSDN, but I can't seem to reference it successfully in Visual Studio 2010.
I have added a reference to System.Runtime.Serialization
, but I still get a compile error if I have a DataContractJsonSerializer
(even with a fully qualified class name. My project is configured to Silverlight 4. The assembly does have a 2.0 version number when I add the reference, but I can't find a version 4.0 assembly.
Why can't I use this class?
Namespace: System.Runtime.Serialization.Json Assembly: System.Runtime.Serialization (in System.Runtime.Serialization.dll)
There is a System.Runtime.Serialization.Json.dll file but that is not where you can find the System.Runtime.Serialization.Json namespace. You actually have to reference the System.ServiceModel.Web.dll library and that is where the DataContractJsonSerializer class. On my machine, the DLL was found here: C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.ServiceModel.Web.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With