Search code examples
c#nosqlneo4jneo4jclient

The type initializer for 'Neo4jClient.GraphClient' threw an exception


I'm new to Neo4j, when I tried to connect to Neo4j server through neo4jclient in the C#, my code have faced to an exception such as image below: Neo4j exception thrwon

the Error is :

The type initializer for 'Neo4jClient.GraphClient' threw an exception.

and the InnerException is:

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.":"Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed

-> also The http://localhost:7474/db/data is the root.

How can I solve this problem?


Solution

  • You can clearly read in the inner exception that it can't load the assembly Newtonsoft.Json. Reference Newtonsoft.Json, preferable by using NuGet.