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"];
    }

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?
Anto Augustine
  • 165
  • 2
  • 5
  • 16
  • 1
    download the latest version of the fb c# sdk. it doesn't require code contracts – prabir Mar 01 '12 at 16:49
  • Thanks @prabir ...But i am using c#2008. my c#sdk version is 5.2.1.0..How can i download the latest version from github. Is the issue due to framework 3.5 and sdk version is targetted on 4.0 ? Please help me.Thanks in advance – Anto Augustine Mar 02 '12 at 04:03
  • use nuget.exe command line. nuget install facebook – prabir Mar 02 '12 at 16:41
  • hello prabir, nuget.exe require framework version 4.0 in my system.Which is not possible in my current environment. Is there any other solution? – Anto Augustine Mar 03 '12 at 04:31
  • 1
    cant u install only the .net framework without vs? if not then download from this url http://packages.nuget.org/api/v1/package/facebook then use your favorite zip program to extract it – prabir Mar 03 '12 at 18:54

1 Answers1

0

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

Nate Totten
  • 8,904
  • 1
  • 35
  • 41