p.campbell
p.campbell

Reputation: 100607

Newtonsoft.Json mismatch in FacebookWebMVC NuGet package?

After loading the Facebook C# SDK (FacebookWebMVC) library from NuGet, I followed exactly the steps at this (excellent!) walkthrough Getting Started with an ASP.NET MVC 3 Website.

I've got my own FB key/secret, implemented the 3 classes in the tutorial, but have this error:

Could not load file or assembly 'Newtonsoft.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed ....

WRN: Comparing the assembly name resulted in the mismatch: Build Number

Occurs on this line:

var loginUri = oAuthClient.GetLoginUrl(new Dictionary<string, object> 
               { { "state", returnUrl } });

Note the 4.0.0.0. Rather on disk is 4.0.2.0; this came bundled in the NuGet package. This file is copied, as expected to my project's bin dir. Version 4.0.2.13622

d:\myproj\packages\Newtonsoft.Json.4.0.2\lib\net40-full\Newtonsoft.Json.dll

How can this be solved?

Upvotes: 2

Views: 812

Answers (2)

Fabio Milheiro
Fabio Milheiro

Reputation: 8474

You need to download release 1 instead of release 2 of the Newtonsoft.Json.

Upvotes: 2

bratsche
bratsche

Reputation: 2674

I've been having this problem today as well. I removed the NuGet packages entirely, used a copy of Newtonsoft.Json.WindowsPhone.dll that I downloaded from the NewtonSoft.Json download page, and I'm using a copy of Facebook.dll that I built here. I don't think you need to build Facebook.dll, it was just that I did that during the course of trying to get somewhere with this problem today.

Upvotes: 0

Related Questions