json - JsonConvert::DeserializeObject erro c++ cli -


i'm trying open file , .json sends class. error when doing.

ref class cutannotationjson {  public:      int index;      string^ nometipo;      double pontox1;     double pontoy1;      double pontox2;     double pontoy2;       double height;       int r;     int g;     int b;       int numbercut;  };  ref class panoramicannotationjson {  public:      int index;      string^ nometipo;      double pontox1;     double pontoy1;      double pontox2;     double pontoy2;      int r;     int g;     int b;  };  ref class dadosjson {  public:      list<panoramicannotationjson^>^ panoramicannotation = gcnew list<panoramicannotationjson^>;      list<cutannotationjson^>^ cutannotation = gcnew list<cutannotationjson^>;  }; 

using

dadosjson^ dadosjson = jsonconvert::deserializeobject<dadosjson^>(file::readalltext("c:/movie.json")); 

error message:

103  intellisense: more 1 instance of overloaded function "newtonsoft::json::jsonconvert::deserializeobject" matches argument list:         function template "t newtonsoft::json::jsonconvert::deserializeobject<t>(system::string ^value)"         function template "t newtonsoft::json::jsonconvert::deserializeobject<t>(system::string ^value, ... cli::array<newtonsoft::json::jsonconverter ^, 1> ^converters)"         argument types are: (system::string ^)   

i'm using newtonsoft::json::;

i cannot reproduce problem. however, explicitly select jsonconvert.deserializeobject(string, jsonserializersettings) overload (which want) via:

dadosjson^ dadosjson = jsonconvert::deserializeobject<dadosjson^>(file::readalltext("c:/movie.json"), (jsonserializersettings ^)nullptr); 

passing nullptr value settings equivalent jsonconvert::deserializeobject<dadosjson^>(file::readalltext("c:/movie.json")).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -