Newtonsoft conflict! Ranorex developers!

Class library usage, coding and language questions.
Ethan
Posts: 16
Joined: Mon Aug 08, 2016 12:09 pm

Newtonsoft conflict! Ranorex developers!

Post by Ethan » Thu Aug 19, 2021 4:02 pm

When I updated to the latest version of Ranorex 10.1.1 I get alot of Newtonsoft-conflicts!

When I imported the new Ranorex.dlls in Visual Studio (I write my test/automation code myself in VS - I do not use Ranorex Studio at all) all hell broke loose. I updated from 9.2 to 10.1.0 yesterday and that seemed to work just fine. Today I updated to 10.1.1 and then the problems started.

It seems like the DLLs are suddenly exposing Newtonsoft and you get namespace conflicts. I tried to mitigate that, but in the end I ended up with this error:

Error CS0433 The type 'JProperty' exists in both 'Ranorex.Plugin.WinForms.Contracts.Core, Version=10.1.1.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a' and 'Ranorex.Plugin.Wpf.Contracts.Core, Version=10.1.1.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a' ......

Is the exposing of Newtonsoft intentional in the first place? After I tried to mitigate the issue I ended up with the error above where there is a conflict within the Ranorex dlls themselfs? I have no idea how to handle that.

I integrate Ranorex like this:

https://www.ranorex.com/help/latest/int ... tegration/

Ethan
Posts: 16
Joined: Mon Aug 08, 2016 12:09 pm

Re: Newtonsoft conflict! Ranorex developers!

Post by Ethan » Thu Aug 19, 2021 8:39 pm

Can add the the first error(s) I got after changing dlls were:

Error CS0433 The type 'JToken' exists in both 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Ranorex.Plugin.WinForms.Contracts.Core, Version=10.1.1.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a'....

Obviously it get many of these erros.

It works if I create a new blank solution and import the ddls, so there is a conflict in my test solution since Newtonsoft.Json is already there. It seems more difficult to handle that one first might think.

Basically I just don't understand why Ranorex would like to do it like this, it's not so nice....

Best regards,

Ethan
Posts: 16
Joined: Mon Aug 08, 2016 12:09 pm

Re: Newtonsoft conflict! Ranorex developers!

Post by Ethan » Thu Aug 19, 2021 10:30 pm

My mistake as probably that I had included Ranorex.Plugin.*.dll as references in the solution, but that included a couple of dlls that should not have been there. Once realising that I had copied too many dlls it builds and runs again.

MichielV
Posts: 12
Joined: Fri Sep 07, 2018 8:12 am

Re: Newtonsoft conflict! Ranorex developers!

Post by MichielV » Wed Nov 24, 2021 5:40 pm

As of 10.1.0 Ranorex is based on .Net framework 4.8. https://www.ranorex.com/release-notes/ This may require some updates of other dependencies such as Newtonsoft to a version that also uses .NET framework 4.8.