开发者

Sample error in sdk

开发者 https://www.devze.com 2023-04-01 09:08 出处:网络
I\'m trying to check out the sample code for the C# Facebook SDK named CS-Canvas-AspNetWebForms-WithoutJsSdk and I\'m getting the following error:

I'm trying to check out the sample code for the C# Facebook SDK named CS-Canvas-AspNetWebForms-WithoutJsSdk and I'm getting the following error:

'Facebook.JsonObject' does not contain a definition for 'id'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Facebook.JsonObject' does not contain a definition for 'id'

Source Error:

Line 30:                 dynamic me = fb.Get("me");
Line 31: 
Line 32:                 imgProfilePic.ImageUrl = string.Format("https://graph.facebook.com/{0}/picture", me.id);
Line 33: 
Line 34:                 lblName.Text = me.name;


Source File: C:\Users\Jessee\Downloads\facebooksdk-71da22b901ac\facebooksdk_71da22b901ac\Sampl开发者_JAVA技巧es\CS-Canvas-AspNetWebForms-WithoutJsSdk\Facebook\Default.aspx.cs    Line: 32 


We (Facebook) do not provide the .NET SDK, but based on this error, it looks like either the JSON deserializer or the property accessor is looking for the id field/property that is not there. My guess is that the network call is not completing (we include the 'id' field in the /me results). I would open a HTTP trace and see if the call is completing.

0

精彩评论

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

关注公众号