开发者

'Facebook.JsonObject' does not contain a definition for 'name' ERROR

I've just installed the facebook c# sdk, but when I'm tring to run the example (after all chenges done in the web.config) I'm receiving this error messgae:

开发者_如何学JAVA'Facebook.JsonObject' does not contain a definition for 'name' 

the code is:

Line 31:         var fb = new FacebookClient(this.CurrentSession.AccessToken);

Line 32:         dynamic myInfo = fb.Get("me");

Line 33:         lblName.Text = myInfo.name;

Line 34:         pnlHello.Visible = true;

the error is in line 33.

What I am doing wrong ?

I've found the sulotion:

line 33 should be -> lblName.Text = myInfo["name"];


Got the reason:

  • You probably added Newtonsoft.Json to the Project.
  • Reason: Adding the whole library Folder to the Project will show up unsatisfied dependencies to it (because of the JsonNetSerializer.cs file) - you do not want to add this to the project either.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜