开发者

"System.MissingMethodException was unhandled"?

开发者 https://www.devze.com 2023-02-18 16:43 出处:网络
I recieve this exception when I try to run the sample application for WP7 that comes with the Facebook C# SDK:

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开发者_Python百科 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.

0

精彩评论

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