locked
Facebook Developer toolkit Users.Getinfo method throws Input string was not in a correct format RRS feed

  • Question

  • User-1246604461 posted


    Trying to implement some Facebook stuff (based on this toolkit: http://facebooktoolkit.codeplex.com/Wikipage)

    I have this code, (triggered after a user has been validated):

                Dim ses As New Facebook.Session.ConnectSession(ConfigurationManager.AppSettings("ApiKey"), ConfigurationManager.AppSettings("Secret"))
                Dim ap As New Facebook.Rest.Api(ses)
                Dim usr As Facebook.Schema.user = ap.Users.GetInfo(userId)
                Dim fullName As String = (usr.first_name & " ") + usr.last_name
                
    But I get this error:


    Input string was not in a correct format.
    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: System.FormatException: Input string was not in a correct format.

    Source Error:

    Line 242:
    Line 244:            Dim usr As Facebook.Schema.user = ap.Users.GetInfo(userId)    <================================error thrown on this line
    Line 245:            Dim fullName As String = (usr.first_name & " ") + usr.last_name


    And Userid does have a value. I also tried it like this:
    Dim usr As Facebook.Schema.user = ap.Users.GetInfo(867345654)

    But the same error occurs.
    Why?!?

    Friday, April 2, 2010 11:48 AM

Answers

  • User-887358719 posted

    this is a known bug they're working on: 

    http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=207870

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 6:46 AM
  • User1657234241 posted

    Solution is already here couple of days. Just download source of the newest library and compile it on your machine

    facebook and facebook.web project, then copy facebook.dll and facebook.web.dll in your project. Here is a link:

    http://facebooktoolkit.codeplex.com/SourceControl/list/changesets

    Actually I downloaded version 48896, but I believe that it is also integrated in the newest version.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 10:21 AM

All replies

  • User-887358719 posted

    this is a known bug they're working on: 

    http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=207870

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 6:46 AM
  • User1657234241 posted

    Solution is already here couple of days. Just download source of the newest library and compile it on your machine

    facebook and facebook.web project, then copy facebook.dll and facebook.web.dll in your project. Here is a link:

    http://facebooktoolkit.codeplex.com/SourceControl/list/changesets

    Actually I downloaded version 48896, but I believe that it is also integrated in the newest version.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 5, 2010 10:21 AM
  • User-1685643308 posted

    Hello,

     

     

    I  have integrated facebook with my web application but I am having a problem I can retrive  the Name , Image and other information but I also want to  get the email address of the user who has logged in .

    Please help me how to do this ..

    regards

    Monday, May 31, 2010 6:23 AM
  • User1657234241 posted

    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Facebook;
    using Facebook.Session;
    using System.Configuration;
    using FVK;

    namespace FVK_Demo
    {
        public partial class Default : System.Web.UI.Page
        {
            private ConnectSession connectSession = ConnectSessionFactory.CreateConnectSession();
            private Facebook.Rest.Api API = null;

            protected void Page_Load(object sender, EventArgs e)
            {
                if (connectSession.IsConnected())
                {
                   API = new Facebook.Rest.Api(connectSession);
                    Facebook.Schema.user loggedUser = null;
                 
                    // get facebook user object
                    loggedUser = API.Users.GetInfo();
                  

                    // get user name
                    string userName = loggedUser.first_name;
               }
                else
                {
                    ErrorLabel.Visible = true;
                }
            }
        }
    }

    Monday, May 31, 2010 6:45 AM