0
votes

I'm a beginner in RavenDB, but I can't seem to get started. I'm getting stuck at loading an entity in C#.

I am getting a null exception error.

Below is my screenshot for the exception: enter image description here

And in my RavenDB studio, it looks like this: enter image description here enter image description here

So, I'm totally stuck now.

I am very sure i have done everything else right. The client has connected to the server with correct Url, the DefaultDatabase is correct, and the session.Load parameter is correct id

Hope someone can help :-)

1
Please provide full exception stack trace. Also, does the problem persist when you use Load<Person> instead of Load<dynamic>? Also, what does the person/1 document look like? - Andrej Krivulčík
Hi Andrej. I have updated the post now. I have also shown the Call Stack now, and also tried to click the View Details on the exception and everything, but there is no more details about the exception. - Assassinbeast

1 Answers

2
votes

Make sure that versions of server package and client nuget match. In your code, you use Url and DefaultDatabase for DocumentStore, both of which were changed a long time ago (May 2017) to Urls and Database.

It is very likely that you use an outdated client package. Install the client package for matching version of RavenDB using Package Manager Console in Visual Studio using a command like this:

Install-Package RavenDB.Client -Version 4.0.0-nightly-20180123-0500 -Source https://www.myget.org/F/ravendb/api/v3/index.json

This command is for the latest nightly version, you want to use -Version matching the server you are running.

Find the appropriate version here: https://ravendb.net/download