c# - Missing method DeserializeObject in assembly.... in MonoDevelop+Newtonsoft -
i have problem when deserializing serialized json c# object using newtonsoft jsonconvert. on linux platform , using monodevelop.
i getting following error message in terminal:
missing method deserializeobject in assembly /home/deepalj/tmp/c#temp/serializertest/serializertest/bin/debug/serializertest.exe, type newtonsoft.json.jsonconvert following code deserialization:
using system; using system.web.script.serialization; using newtonsoft.json; namespace serializertest { class mainclass { public static void main (string[] args) { payment p = newtonsoft.json.jsonconvert.deserializeobject<payment> ("{ id: 10, card: 'visa', amount: 1}"); console.writeline ("card: "+p.card+"\n"+"amount: "+p.amount); } } } following payment class:
using system; namespace serializertest { public class payment { public int id { get; set; } public string card { get; set; } public decimal amount { get; set; } } } any fix helpful.
thanks.
i figured out solution. instead of adding newtonsoft.json package references->edit references->packages , included .net assembly manually using references->edit references->.net assembly. downloaded newtonsoft json pakage here , added bin/net45/newtonsoft.json.dll .net assembly. works well.

Comments
Post a Comment