2014-04-19 33 views
1

我在使用Facebook .SDK for .NET時遇到了一個奇怪的錯誤。我正在寫會用這個包裝我的第一個應用程序,我不知道我怎樣才能解決這個錯誤:在Windows 8.1中的.NET錯誤的Facebook .SDK

An exception of type 'Facebook.WebExceptionWrapper' occurred in mscorlib.dll but was not handled in user code

Additional information: The underlying connection was closed: An unexpected error occurred on a send.

在下面的代碼:

var accessToken = facebookOAuthResult.AccessToken; 
FacebookClient client = new FacebookClient(accessToken); 
client.AppId = _facebookAppId; 
dynamic aboutMeResult = await client.GetTaskAsync("/me"); // here an error occurs 
var result = (IDictionary<string, object>)aboutMeResult; 
var data = ((IEnumerable<object>)result["data"]).ToList(); 
var aboutMe = (IDictionary<string, object>)data[0]; 
Profile.CreateProfile((string)aboutMe["first_name"] + " " + (string)aboutMe["last_name"], true); 

我使用Windows 8.1和visual studio 2013,我正在創建一個商店應用程序。

在此先感謝。

回答

1
client.GetCompleted += async(o1, e1) => 
{ 
    if (e1.Error != null) 
    { 
     return; 
    } 
    var result1 = (IDictionary<string, object>)e1.GetResultData(); 


    JObject jobj1 = JObject.Parse(e1.GetResultData().ToString()); 
    JArray x1 = (JArray)jobj1["data"]; 

}; 
await client.GetTaskAsync("me/permissions?"); 

乾杯!