I'm new to neo4j and having trouble t connect to the Neo4J server wth .NET.
I have installed both the Neo4j DB (v2.2.2) and neo4jclient (v 1.0.0.662) with Install-Package Neo4jclient in Visual Studio, created an empty project with the below code
GraphClient Client;
Client = new GraphClient(new Uri("http://localhost:7474/db/data/"));
Client.Connect();
The Problem is that I get an error saying that I'm missing GraphClient.cs. Is there anything else I need to install or download?
Thanks
EDIT: Since this was originally written the client has moved on a bit (any version >
1.1.0.0
), and you can pass in the auth details on construction (which is the preferred way):Because you're on 2.2x of Neo4j, you'll have a user/pass element (unless you've turned it off), so you have 2 options, 1 turn off the authentication, 2 send the authentication through with your calls.
Method 1 - Disable Authentication
Personally - for local dev work I tend to turn it off. To do this, go to the place you installed Neo4j, and go to the
conf
folder. In there, edit theneo4j-server.properties
file. Roughly around line 24 there should be a line reading:All you need to do is set that to
false
and you should find your connection will work.Method 2 - Send Authentication Details
You'd need to do this for a live version (unless you plan to not use auth with your db), you have two options both detailed here: Upgrading your Neo4j to 2.2 and having Auth trouble? The quick way is to pass the auth stuff with the URI, so instead of
http://localhost.:7474/db/data
you do something like:http://username:password@localhost.:7474/db/data
.The other route involves injecting the Authentication Header into all the requests made - you create a client authentication wrapper:
and then inject it into
Neo4jClient
like so:the choice, as they say, is yours.