Monday, June 29, 2009

Unable to cast object of type 'System.Int32' to type 'System.String' :Error in Facebook Application

If you are getting "Unable to cast object of type 'System.Int32' to type "'System.String' error while using facebook.net from nikhil (http://www.nikhilk.net/FacebookNET.aspx) ,

to solve this error download source code for this dll and make a change in Framework\Service\Core\FacebookRequest.cs line 180 change

//userID = (string)result["uid"];
to userID = Convert.ToString(result["uid"]);