0

I just installed the Nuget package Newtonsoft.Json and I think that's the reason why this line of code:

IndexCreation.CreateIndexes(typeof(DataAccessFactory).Assembly, documentStore);

... is generating this error:

Newtonsoft.Json.JsonReaderException: {"Unexpected character encountered while parsing value: <. Path '', line 0, position 0."}

I found a question where the issue was different Raven client and server versions. But that's not the issue in my case. And I found another question where the issue was conflicting Newtonsoft.Json assemblies; one version used by RavenDB, and another used by SignalR.

What I don't understand is what Newtonsoft.Json.dll to use for RavenDB 2230. Older versions of RavenDB had Newtonsoft.Json.dll in the Server folder. RavenDB 2230 doesn't have Newtonsoft.Json.dll anywhere in its folder structure. Why? If RavenDB needs Newtonsoft.Json.dll, why isn't it there? And if it needs it, how do I know what version to use? If I know that, I can redirect SignalR to use this version (as shown in one of the answers to one of the questions above).

To further complicate matters, I can't uninstall the Newtonsoft.Json package. I get an error that SignalR depends on it. If I uninstall the SignalR package first, I can then uninstall the Newtonsoft.Json package. However, when I install SignalR again, it installs Newtonsoft.Json with it. I don't want that Newtonsoft.Json, but Nuget gets installs it for me. This feels like DLL hell all over again.

Community
  • 1
  • 1
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
  • RavenDB 2.0 has its own copy of json.net embedded in the main assembly. You'll find it in the Raven.Imports.Newtonsoft.Json namespace. So you don't need your own copy at all for RavenDB purposes. Your error must be related to something else. – Matt Johnson-Pint May 20 '13 at 04:28
  • Thanks, Matt. I started fresh and added the SignalR client: `Install-Package Microsoft.AspNet.SignalR.Client`. This time, the `bindingRedirect` was automatically added to my app.config file. Not sure why that didn't happen the first time. I'll have to keep playing around with it. – Bob Horn May 20 '13 at 13:21

0 Answers0