Facebook权限错误

时间:2012-11-24 20:47:10

标签: c# facebook facebook-graph-api facebook-c#-sdk

public Form1()
        {
            InitializeComponent();

            // The application key of the Facebook application used
            fbService.ApplicationKey = "XXXXXXXXXXX";

            // Add all needed permissions
            List<Enums.ExtendedPermissions> perms = new List<Enums.ExtendedPermissions>
            {
               Enums.ExtendedPermissions.none
        };
            fbService.ConnectToFacebook(perms);   //error here (The given key was not present in the dictionary.)         
        }

我提到错误,我收到错误,因为我是facebook api的新手,特别是c#的新手,任何解释的答案都是appriciated 谢谢

1 个答案:

答案 0 :(得分:0)

在FacebookClient上使用静态方法,如下所示:

FacebookClient.SetDefaultHttpWebRequestFactory(uri => {
    var request = new HttpWebRequestWrapper((HttpWebRequest)WebRequest.Create(uri));
    request.Proxy = ......; // normal .net IWebProxy
    return request;
});

另请参阅此答案:Facebook SDK Proxy setting C#