简体   繁体   English

“System.MissingMethodException未处理”?

[英]“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: 当我尝试运行Facebook C#SDK附带的WP7示例应用程序时,我收到此异常:

File or assembly name 'Microsoft.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=736440C9B414EA16', or one of its dependencies, was not found. 找不到文件或程序集名称“Microsoft.Contracts,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 736440C9B414EA16”或其中一个依赖项。

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". 我找不到“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. 编辑:当在MainPage构造函数中创建FacebookClient的新实例时,它会特定发生。

It appears that Microsoft Code Contracts are not available for Windows Phone 7 . 似乎Microsoft Code Contracts 不适用于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. 您正在使用的库的开发人员包含对此程序集的引用,但它不适用于Windows Phone平台。

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. 要解决此问题,您需要获取一个没有Microsoft.Contracts.dll引用的.NET程序集(DLL)版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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