开发者

Type or assembly FacebookClient could not be found

开发者 https://www.devze.com 2023-04-03 14:42 出处:网络
I have download C# sdk and added dll from \\Bin\\Release\\Net40 ,to my website bin folder开发者_JAVA百科.Given reference of it.I am using vs2010.

I have download C# sdk and added dll from \Bin\Release\Net40 ,to my website bin folder开发者_JAVA百科.Given reference of it.I am using vs2010.

using Facebook;
using Facebook.Web;
using Facebook.Web.Mvc;
using Newtonsoft.Json;

There is another folder called CodeContracts in Net40 in that 3 dll file.Out of that ,I was able to add 2 dll's(Facebook.Web.Contracts.dll,Facebook.Web.Mvc.Contracts.dll) reference to my project.One file(Facebook.Contracts.dll) refernce enable to add.That time throws an error("Class Facebook.JsonObject exist in both file").FacebookClient is not visible.I am getting error Type or assembly FacebookClient could not be found.

public JsonObject CreateAlbum(string accessToken)
        {
            FacebookClient facebookClient = new FacebookClient(accessToken);
            Dictionary<string, object> albumParameters = new Dictionary<string, object>();
            albumParameters.Add("message", "My Album message");
            albumParameters.Add("name", "Album Name");
            JsonObject resul = facebookClient.Post("/me/albums", albumParameters) as JsonObject;
            return resul;
        }


don't add reference too Facebook.Contracts.dll, Facebook.Web.Contracts.dll, Facebook.Web.Mvc.Contracts.dll

since u are using vs2010, you might wnat to use nuget instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消