1

UPDATE: I have tried using dependentAssembly -> bindingRedirect in the web.config in different combinations. I also tried adding a app.config to my "DataAccess" project and adding the bindingRedirect in there. I have used all possible combinations I could think of but, in both config files and on their own, but nothing seems to work. Maybe I did it wrong

I decided to try MVC3 + EXT.Net V2.0 and RavenDB using n-tier architecture.

I added Ext.Net using NuGet in my MVC project and this in turn added Newtonsoft.Json (version 4.5.7) as it is a dependency. All still good, everything builds and executes as expected.

Next I decided to add a new project "Entities" where I will implement my Entities and their Repository Interfaces/Classes. Ok, everything is still good and builds.

Then I added another project "DataAccess". I manually added references to RavenDB and Newtonsoft.Json (version 4.0.8.0) that is bundled with Raven. I implemented a simple RavenDB session and method to store an object.

I rebuilt the whole solutions and there were no errors, however when I run the application I get the following error

Could not load file or assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

at

Line 17: store = new DocumentStore() (This is in my "DataAccess" project)

Stack Trace

[FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] Raven.Client.Document.DocumentConvention..ctor() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\DocumentConvention.cs:84...

Is there anyway to fix this error without rebuilding any of the third party assemblies myself?

The RavenDB code works by itself if I remove references to EXT.Net and Newtonsoft.Json (4.5.7) and vice versa the EXT.Net code works when I remove references to RavenDB and Newtonsoft.Json (4.0.8.0)

Eugene Niemand
  • 721
  • 6
  • 28
  • Take a look at this question: http://stackoverflow.com/questions/215026/the-located-assemblys-manifest-definition-does-not-match-the-assembly-reference It may help. – Saedeas Jul 16 '12 at 16:03
  • @Saedeas Thanks, I had a thorough look at that question before I posted this question. What I could gather in that question is that a single assembly was looking for a specific dependency version that was not found, where as in my case I have two unrelated assemblies in separate projects, part of the same solution,looking for different versions of the same dependency but it is only locating the one version. – Eugene Niemand Jul 17 '12 at 15:25

1 Answers1

0

RavenDB 960 uses Newtonsoft.Json 4.0.8, you can use RavenDB 1.2 unstable, which internalized the Newtonsoft.Json support.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • Thanks Ayende, I guess this will fix my error but is there anyway of making this work without using your solution? If its not possible that is fine, I just want to know if there is an alternative solution. – Eugene Niemand Jul 17 '12 at 15:20