Ayende @ Rahien

Refunds available at head office

RavenDB 1.0 & Newtonsoft.Json 4.5.7

A common complaint that we hear about RavenDB 1.0 is that it depends on Newtonsoft.Json 4.0.8, while many libraries are already using 4.5.7. We already resolved the problem once and for all in the RavenDB 1.2 branch, but that is a few months from going live yet.

Therefor, we create a new nuget package: http://nuget.org/packages/RavenDB.Client/1.0.971

This nuget package is the exact same as 960, except that we compiled it against Newtonsoft.Json 4.5.7. Note that this is only supported for the client mode, if you want to run RavenDB Server or RavenDB Embedded, it is still going to require Newtonsoft.Json 4.0.8 in the 1.0 version.

The main idea is that you can get to run against RavenDB Server using Newtonsoft.Json 4.5.7 on the client side, which is the most common scenario for RavenDB.

Tags:

Posted By: Ayende Rahien

Published at

Originally posted at

Comments

David
07/31/2012 07:48 AM by
David

That's great news Ayende, thanks!

/David

Marcos
07/31/2012 12:05 PM by
Marcos

You can try with ILMerge with /internalize option to hide the json dependency and provide some wrappers if you already return objets of the Newtonsoft library.

Cheers

Roger
07/31/2012 07:01 PM by
Roger

I would like to hear more about how you solved it in 1.2. I am about to release an update to Gallery Server Pro that includes this library, and I want to avoid the pitfalls.

Louis
07/31/2012 09:22 PM by
Louis

They are using git subtree (https://github.com/ayende/ravendb/blob/1.2/Imports/Pull.ps1) to pull in the sources. After that they do a find&replace to prefix the namespace with Raven.Imports (https://github.com/ayende/ravendb/commit/d3ee433ab4e5a8871a2d5772b4634fef166b224b)

Ayende Rahien
08/01/2012 09:58 AM by
Ayende Rahien

Roger, For 1.2, we internalized json.net

Roger
08/01/2012 01:14 PM by
Roger

Ayende: What do you mean by "internalize"? Are you talking about embedding the json.net DLL inside another DLL?

LaptopHeaven
08/03/2012 12:52 AM by
LaptopHeaven

Are you planning on releasing a RavenDB Client MvcIntegration nuget package which depends on 1.0.971?

Dan Turner
08/03/2012 01:39 AM by
Dan Turner

Damn... I would really like a similar version of RavenDB.Embedded :(

I'm guessing this is non-trivial for you guys to do?

Ayende Rahien
08/03/2012 05:34 AM by
Ayende Rahien

LaptopHeaven & Dan, this is a interim release, and a small one at that, we don't want to do the full work required to move to 4.5.7 for the entire product. There are a LOT that is going on there. That is why we released just the stuff that is required to work with a remote server.

Dan Turner
08/03/2012 05:38 AM by
Dan Turner

Fair enough mate!

Do you have any ETA on the next stable version of the embedded package that is compatible with Newtonsoft.Json 4.5.8?

Ayende Rahien
08/03/2012 05:40 AM by
Ayende Rahien

Dan, A couple of months, I guess.

nicolas
09/14/2012 09:40 AM by
nicolas

just moved a project and those dll issues were quite a pain. for some reason, the nuget kept referencing the dlls in the bin/ directory. it is a good thing you internalize and minimize dependencies. those dependencies woes have been around since the dark age of computing. i am dreaming of a definitive, bullet proof, and simple, solution to it.

Koen Verheyen
11/22/2012 10:28 PM by
Koen Verheyen

I'm not totally convinced internalizing is good. I want to put my models in a common portable assembly between a web api (requires >= Json 4.5.8) server with ravendb client and a windows phone app. My models have json ignore attributes (to direct ravendb) but with the internalized json I would have to reference ravendb.client in my common assembly (which is not even possible).

Does that make sense or am I breaking any ground rules? Or should I be using linked files instead of common models?

Ayende Rahien
11/22/2012 11:42 PM by
Ayende Rahien

Koen, You can customize the ravendb json serializer to ignore those attributes, but yes, that is the idea. Considering how many json.net version there are out there, there is really no other real choice for us.

Comments have been closed on this topic.