解析未定义的值时出错。路径'',第0行,位置0.在Windows Phone 8开发中序列化匿名类型时

时间:2013-06-21 07:03:39

标签: windows-phone-8 json.net

这是我的代码..

var signUpData = new
{
   first = "abcd",
   last ="efgh",
   email ="sometext",
   password = "sometext",
   phone = contactSession.ContactNumber,
   dialing_code = "some",
   country = "some"
};

JsonBody = Newtonsoft.Json.JsonConvert.SerializeObject(signUpData);

var tcs = new TaskCompletionSource<Tuple<string, bool>>();

tcs.SetResult(new Tuple<string, bool>(request.ResponseBody,false));//request.ResponseBody is jsonbody that comes from server.

var result = await tcs.Task;

if (result.Item2 == false)
        {
            var errors = JsonConvert.DeserializeAnonymousType(result.Item1, new { error    = "" });

            return false;
        }

然后我有时并非总是犯错误。

情景是什么?

谁能说出来?`

0 个答案:

没有答案