Sample error in sdk
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.
精彩评论