简体   繁体   中英

“System.MissingMethodException was unhandled”?

I recieve this exception when I try to run the sample application for WP7 that comes with the Facebook C# SDK:

File or assembly name 'Microsoft.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=736440C9B414EA16', or one of its dependencies, was not found.

It occurs at this part in code:

// Constructor
    public MainPage()
    {
        InitializeComponent();
        _fbClient = new FacebookClient();
        FacebookLoginBrowser.Loaded += new RoutedEventHandler(FacebookLoginBrowser_Loaded);
    }

Not sure what this means, as this is the first time I recieve this error. And I can't find "Microsoft.Contracts". I tried rebuilding and everything works nicely, but when I run I recieve the exception.

Can someone explain whats going on and maybe how to fix it?

EDIT: It occurs specifcly when a new instance of the FacebookClient is created in the MainPage Constructor.

It appears that Microsoft Code Contracts are not available for Windows Phone 7 . The developer of the library you are using included a reference to this assembly and it is not available for the Windows Phone platform.

To fix this you would need to obtain a version of the .NET assembly (DLL) that does not have a reference to Microsoft.Contracts.dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM