"System.MissingMethodException error was unhandled?"

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

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

This happens in this part of the code:

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

Not sure what this means, since this is the first time I am getting this error. And I can not find "Microsoft.Contracts". I tried rebuilding and everything works fine, but when I start, I get an exception.

Can someone explain what is happening, and maybe how to fix it?

EDIT: This happens on purpose when a new instance of FacebookClient is created in MainPage Constructor.

+4
source share
1 answer

It seems that Microsoft Code Contracts are not available for Windows Phone 7 . The developer of the library used included a link to this assembly, and it is not available for the Windows Phone platform.

To fix this, you will need to get the version of the .NET assembly (DLL), which does not have a link to Microsoft.Contracts.dll.

+4
source

Source: https://habr.com/ru/post/1344693/


All Articles