Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I install ravendb client alongside Microsoft.AspNet.WebApi.Client?

I'm trying an ASP.NET MVC4 Web API project. I'm trying to install the ravendb client through nuget. This is the error:

Attempting to resolve dependency 'NLog (= 2.0.0.2000)'.
Successfully installed 'Newtonsoft.Json 4.0.8'.
Successfully installed 'NLog 2.0.0.2000'.
Successfully installed 'RavenDB.Client 1.0.960'.
Install failed. Rolling back...
Updating 'Newtonsoft.Json 4.5.1' to 'Newtonsoft.Json 4.0.8' failed. Unable to find a version of 'Microsoft.AspNet.WebApi.Client' that is compatible with 'Newtonsoft.Json 4.0.8'.

So I can see that Microsoft ASP.NET Web API Client Libraries (I think this is what I have installed: http://nuget.org/packages/Microsoft.AspNet.WebApi.Client) has a dependency on Newtonsoft.Json (≥ 4.5.1)

And this says the ravendb client install requires (= 4.0.8) http://nuget.org/packages/RavenDB.Client/1.0.960

So I've looked and this question is very similar: Nuget package dependencies. Does it work the way it should? but this is a bit older and looks like the problem there is different- here Raven does actually seem to need Newtonsoft.Json 4.0.8

So my question is, is this possible? Is there some way (maybe from the command line/ through the console) that I can get these 2 things installed side by side. How can I get Microsoft.AspNet.WebApi.Client to play nicely with Newtonsoft.Json?


EDIT: This problem and solution are obsolete. There have been four stable RavenDB builds since this question was posted. The latest stable build will in fact fix this issue, and one should not experiment with an unstable build simply to fix this problem.

like image 235
DannykPowell Avatar asked Jun 10 '12 17:06

DannykPowell


2 Answers

There are two solutions to this problem from the ravendb google groups:

Use the new (and unstable) v1.2 RavenDB, this fixes the issue by internalizing their dependency on Json.Net, so you might be able to get that version instead of the v1 from Nuget.

http://builds.hibernatingrhinos.com/builds/RavenDB-Unstable and download build 2014

Or apparently you can use the beta version of WebApi which doesn't use Json.net as its serializer.

for more info on this issue look at:

https://groups.google.com/d/topic/ravendb/7qS4YspGnOo/discussion https://groups.google.com/d/topic/ravendb/4qTcE3Up6k0/discussion

like image 126
Andy Long Avatar answered Oct 04 '22 19:10

Andy Long


As mentioned already by theoutredge, using the unstable version of the client solves the problem. I have just installed RavenDB Client build 2025.

If you want to use NuGet, you will have to install using the console and specify the '-Pre' argument:

Install-Package RavenDB.Client -Pre

grabs the latest unstable version of RavenDB.

like image 37
hoonzis Avatar answered Oct 04 '22 19:10

hoonzis