I added json dll to my project and tried serializing the object:
ProductType itemToEdit = new ProductType("Name"); string jsonString = JsonConvert.SerializeObject(itemToEdit);
An error message will appear:
An exception of type 'System.MissingMethodException' occurred in Newtonsoft.Json.DLL, but was not handled in user codeAdditional information: Method not found: 'Boolean System.Runtime.Serialization.DataContractAttribute.get_IsReference () ".
An exception of type 'System.MissingMethodException' occurred in Newtonsoft.Json.DLL, but was not handled in user code
Additional information: Method not found: 'Boolean System.Runtime.Serialization.DataContractAttribute.get_IsReference () ".
But the project is building correctly.
I had the same problem. Installing the .NET framework 3.5 SP1 solved the problem. The DataContractAttribute.IsReference property is supported only in the .NET framework 4, 3.5 SP1, and 3.0 SP2.
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.isreference.aspx.
, , Newtonsoft.Json Windows Phone 7.
"System.MissingMethodException", Newtonsoft.Json.DLL JsonConvert.SerializeObject.
NuGet, , , Newtonsoft.Json.Silverlight.
Newtonsoft.Json.WindowsPhone, .