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)