WP7 で JSON.Net を使用して文字列を逆シリアル化する際に問題があります。私はこのJSON文字列を持っています:
私はそれからクラスを生成しました( http://json2csharp.com/ )。
void GETHotels()
{
WebClient c = new WebClient();
c.DownloadStringAsync(new Uri(@"..."));
c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadStringCompleted);
}
DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
var deserialized = JsonConvert.DeserializeObject<List<Classes.RootObject>>(e.Result);
}
しかし、e.Result を逆シリアル化しようとすると、例外が発生します。
値「[{"hotId": ... 6390285}]」を「System.Collections.Generic.List`1[Hotel_cz.Classes.RootObject]」型に変換中にエラーが発生しました。パス ''、1 行目、位置 971。
誰かがこの問題で私を助けることができますか?