microsoft.contracts dll error when creating facebookclient object in facebook c#sdk

556 Views Asked by At
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"];
    }

the above code generated error......

Could not load file or assembly 'Microsoft.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16' or one of its dependencies. The system cannot find the file specified.

my web.config section is as follows

<configSections>

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

There are 1 best solutions below

1
Nate Totten On

You are using an old version of the Facebook C# SDK. Download the current release which does not depend on Code Contracts.

Related Questions in FACEBOOK-C#-SDK