首页 文章

在facebook c#sdk中创建facebookclient对象时,microsoft.contracts dll错误

提问于
浏览
0
using Facebook;
using Facebook.Web;

public pageLoad()


public void fetchFacebookData()
    {
        var fbApp = new FacebookClient();// error occured at this line
        var result = (IDictionary<string, object>)fbApp.Get("me");
        var name = (string)result["name"];
    }

上面的代码生成错误......

无法加载文件或程序集“Microsoft.Contracts,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 736440c9b414ea16”或其依赖项之一 . 该系统找不到指定的文件 .

我的web.config部分如下

<configSections>

         <section name="facebookSettings" type="Facebook.FacebookConfigurationSection,Facebook" allowLocation="true" allowDefinition="Everywhere"/>
        </configsection>
<facebookSettings
    appId="1xxxxxxxx"   appSecret="eeeeeeeeeeeeeeeeeee"/>
</facebookSettings?

1 回答

  • 0

    您使用的是旧版本的Facebook C#SDK . 下载不依赖于代码 Contract 的当前版本 .

相关问题