Is it possible to get current Raven.Client.Lightweight and Raven.Abstractions dlls?

267 views
Skip to first unread message

MostHated

unread,
Apr 23, 2018, 8:00:55 AM4/23/18
to RavenDB - 2nd generation document database
Hello there,
    I am using Unity and I have a project that was built using RavenDB and it is using the Raven.Client.Lightweight.dll and Raven.Abstractions.dll files. I loaded up RavenDB 4.0 on my pc to see if it would work but I was getting the errors of :

WebException: The remote server returned an error: (400) Bad Request.
Rethrow as BadRequestException: There is no handler for path: GET

    I went to look it up online and saw one of them was because someone was using an older version of the dlls to connect to the newer DB, so I figure that is the case here as well. Is it possible to find or make the dlls that I need in order to get this project working? If someone could point me in the right direction, I would very much appreciate it.

Thanks!

Tal Weiss

unread,
Apr 23, 2018, 8:14:31 AM4/23/18
to RavenDB - 2nd generation document database
At a glance, it seems you're trying to run Ravendb v3.x client on a Ravendb v4.0 server this won't work.
Please make sure both server and client are v4.0 

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

MostHated

unread,
Apr 23, 2018, 8:26:10 AM4/23/18
to RavenDB - 2nd generation document database
Is there anywhere you can point me that might have tips or instructions on how to make the client up to date with 4.0? The project I am working with is already complete and coded for whichever version it was using before. Is there some sort of list of the changes between 3.x and 4.0 so I know what might need to be updated on the client side?

Thanks!

Tal Weiss

unread,
Apr 23, 2018, 8:51:33 AM4/23/18
to RavenDB - 2nd generation document database
If you're using nuget to install the client in your project you should just install the latest nuget package, from the nuget package manager console:
Install-Package RavenDB.Client -Version 4.0.3

make sure that you guys were not referencing the DLLs directly from your solution, go to your project and verify that you don't have raven client dll under references/dependencies you should only have the nuget package.

Version 3.x and 4.0 are not compatible 

On Mon, Apr 23, 2018 at 3:26 PM, MostHated <m374...@gmail.com> wrote:
Is there anywhere you can point me that might have tips or instructions on how to make the client up to date with 4.0? The project I am working with is already complete and coded for whichever version it was using before. Is there some sort of list of the changes between 3.x and 4.0 so I know what might need to be updated on the client side?

Thanks!

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MostHated

unread,
Apr 23, 2018, 9:02:14 AM4/23/18
to RavenDB - 2nd generation document database
Thank you for the reply. I realize they are not compatible,here a quick example of what I mean. I have the latest DLL's in my project, but when I removed the Raven.Abstraction and Client.Lightweight I, of course, have several missing items such as the items below. Some of them were able to automatically pick up their references from the new dll's, but there are a few which I can't seem to figure out where I need to point them, or what I need to change them to.

DefaultDatabase = this.databaseName,
Conventions = {FailoverBehavior = FailoverBehavior.FailImmediately}

Then also

new PatchRequest
{
Type = PatchCommandType.Add,
Name = "FriendsList",
Value = RavenJValue.FromObject(friend.Name)
}


Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 9:23:39 AM4/23/18
to ravendb

MostHated

unread,
Apr 23, 2018, 9:35:09 AM4/23/18
to RavenDB - 2nd generation document database
Great, thanks!

MostHated

unread,
Apr 23, 2018, 10:03:21 AM4/23/18
to RavenDB - 2nd generation document database
I was able to get a few of them worked out, I am still having issues with a few though and neither page showed how to fix it. The API list showed that it was removed, but that was about it. I do apologize if my questions have simple answers and I just do not know them, not only am I new to RavenDB, I am new to C# as well. I have only been using it for a few months trying to learn to make some games in Unity. I have only worked with MySQL before with PHP and this is quite a bit different. 

store.DatabaseCommands.Patch( id, new[] { patchRequest });

await store.AsyncDatabaseCommands.PatchAsync(id, new[] {patchRequest}, true);

store.DatabaseCommands.Patch(id, patchRequests);

and quite a few others like that.

Tal Weiss

unread,
Apr 23, 2018, 10:55:45 AM4/23/18
to RavenDB - 2nd generation document database

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M374llic4

unread,
Apr 23, 2018, 11:48:36 AM4/23/18
to rav...@googlegroups.com
Hmm... I tried to convert it to use what I think it's wanting but it doesn't seem to be liking it.

public void Patch(string id, PatchRequest patchRequest)
{
    var session = store.OpenSession();
                    session.Advanced.Patch(id, new[]{ patchRequest });

                   /* The original command
                   store.DatabaseCommands.Patch(
id,
new[]
{
patchRequest
});
                   */
}

Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 11:50:06 AM4/23/18
to ravendb
What is the full code that you are trying to convert?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


M374llic4

unread,
Apr 23, 2018, 11:57:28 AM4/23/18
to rav...@googlegroups.com
This would be it right here.

Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 12:07:04 PM4/23/18
to ravendb
What are you calling this with?

public void Patch(string id, PatchRequest patchRequest) 

M374llic4

unread,
Apr 23, 2018, 12:16:43 PM4/23/18
to rav...@googlegroups.com
There are a few places, here is one


Which comes from here

this is another one.


This is an interface that they use

M374llic4

unread,
Apr 23, 2018, 12:20:16 PM4/23/18
to rav...@googlegroups.com
This is the one that loads the data at the start.

https://hastebin.com/ivifadinok.cs

M374llic4

unread,
Apr 23, 2018, 12:27:59 PM4/23/18
to rav...@googlegroups.com
Not sure if it matters, I keep finding more places it is saving though.

Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 12:29:28 PM4/23/18
to ravendb
I'm talking specifically about the Patch calls.

M374llic4

unread,
Apr 23, 2018, 12:42:26 PM4/23/18
to rav...@googlegroups.com
Upon searching, it looks like these two are the ones I could easily find.

M374llic4

unread,
Apr 23, 2018, 12:43:22 PM4/23/18
to rav...@googlegroups.com
I attempted to change them as per needed, but got stuck at the part of PatchCommandType.Add, and PatchCommandType.Set,

Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 3:49:58 PM4/23/18
to ravendb
Using scripted patch, this becomes:

await this.server.CharacterDatabase.PatchAsync(SocialProfileData.GenerateId(guid),
  new PatchRequest
  {
  "Type" , PatchCommandType.Add,
  "Name", "Friends",
  "Value", friend.Name
  });



            var patchRequest = new PatchRequest
            {
                Script = $"this.Friends.push($name);",
                Values = { ["$name"] = friend.Name }
            };

session.Advanced.Defer(new PatchCommandData(id, null, patchRequest, null));

Oren Eini (Ayende Rahien)

unread,
Apr 23, 2018, 3:50:32 PM4/23/18
to ravendb
And the Set is just:

  var patchRequest = new PatchRequest
            {
                Script = $"this.Level = $v;",
                Values = { ["$v"] = newLevel }
            };

MostHated

unread,
Apr 23, 2018, 3:56:21 PM4/23/18
to RavenDB - 2nd generation document database
Thank you very much, I appreciate it! 

I believe I only have one issue left, for some reason this :

public DatabaseFactory(string databaseName)
{
DatabaseName = databaseName;
                store = new DocumentStore
                {
                    Urls = new[] { "http://127.0.0.1:8080" },
                    Database = DatabaseName
                }.Initialize();
        }

Keeps giving me the error of "ArgumentException: Object of type 'System.Reflection.BindingFlags' cannot be converted to type 'Newtonsoft.Json.Utilities.BindingFlags'.
Rethrow as TypeInitializationException: The type initializer for 'Raven.Client.Documents.Conventions.DocumentConventions' threw an exception."

I tried searching for it, but nothing came up between system.reflection binding and newtonsoft with binding. Any ideas?

M374llic4

unread,
Apr 23, 2018, 4:50:46 PM4/23/18
to rav...@googlegroups.com
Upon further investigation, it looks like there is some sort of reflection error somewhere which might actually have nothing to do with this. I have had that happen not too long ago and it seems to make certain things look like they are the problem when they really are not.

M374llic4

unread,
Apr 24, 2018, 7:02:17 PM4/24/18
to rav...@googlegroups.com
It looks like I got it worked out, I had to switch to the beta version of Unity 2018.1 (which should be actually live any day now), turns out they were not support .netstandard in 2017.

I did still have a question about this though. I got one of them worked out by using 

public void Patch(string id, PatchRequest patchRequest)
{
    using (var session = store.OpenAsyncSession())
    {
        session.Advanced.Defer(new PatchCommandData(id, null, patchRequest, null));
    }
}

but the async one is not liking that:

public async Task PatchAsync(string id, PatchRequest patchRequest)
{
    using (var session = store.OpenAsyncSession())
    {
        await session.Advanced.Defer(new PatchCommandData(id, null, patchRequest, null));
    }
             // await store.AsyncDatabaseCommands.PatchAsync(id, new[] {patchRequest}, true);   ---------- Original
}

The original one also looks like it was using  new[] {patchRequest}, I tried that and it didnt like that either. The main error though ends up with : 

"Cannot await void" within Visual Studio.

Oren Eini (Ayende Rahien)

unread,
Apr 25, 2018, 6:55:15 AM4/25/18
to ravendb
You are missing session.SaveChanges() for the sync version and await session.SaveChangesAsync() for the async

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


Reply all
Reply to author
Forward
0 new messages