Problem with Api.Users.GetInfo();

Apr 6, 2010 at 8:44 PM

I downloaded beta release 3.1 and now I have problem with GetInfo() method, sometimes it doesn't return enything. Also in previous version of Toolkit I have this code:

Facebook.Session.IFrameCanvasSession cs = new Facebook.Session.IFrameCanvasSession("xxx", "xxx");
Api = new Facebook.Rest.Api(cs);
u = Api.Users.GetInfo();

but now i must remove cs.Login() because the application refresh continously without stop. Please for help.

Apr 7, 2010 at 4:55 AM


can you explain in more detail what you experience?
I am also using v 3.1 with a silverlight app and when I use Google Chrome my app becomes unresponsive.  With the Task Manager I see the memory usage shooting up. After a while the browser offers to stop the unresponsive Silverlight plugin...

Anyone else experienced this?


Apr 7, 2010 at 10:48 AM

When I try this command (after the commands given in previous post): string x = u.uid.ToString();

SOMETIMES I got this error:

System.NullReferenceException: Object reference not set to an instance of an object. at ___ in ___:line __

where u is Facebook.Schema.user.

Apr 7, 2010 at 10:19 PM

I have been able to fix the problem we are having. It was a problem in our code but only became apparent with v3.1.
So far v3.1 is working well on silverlight (at least on windows).

Regarding your code you should verify that the login call succeeds, before calling any other API methods.
I normally retry calling facebook API methods 5 times before aborting, because it does happen that they do fail from time to time.

Apr 8, 2010 at 9:17 AM

I include the code above in every page, because I want to read user data. With previous version of toolkit it works fine. Also if someone try to open some page outside the facebook, cs.Login() automaticly redirect to Facebook.


Now, the command cs.Login() produce this error:

System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at Facebook.Session.IFrameCanvasSession.RedirectTopFrame(String redirect) at Facebook.Session.IFrameCanvasSession.RedirectToLogin() at Facebook.Session.CanvasSession.Login() at ____ in ____:line ____

and the application refresh continously without stop.


Without cs.Login(), the application works fine (instead of Api.Users.GetInfo() now I use cs.UserId), but when user is inactive (for example 10 minutes), and then click on some link in application, the facebook refresh and open the first page of application :(