Ranorex 4.0.2 and Newtonsoft.Json

Bug reports.
mgrybyk
Posts: 8
Joined: Fri Feb 22, 2013 12:19 pm

Ranorex 4.0.2 and Newtonsoft.Json

Post by mgrybyk » Fri Feb 22, 2013 12:28 pm

Hello,

I have Newtonsoft.Json.dll used in my solution (MS VS2010), version 4.5.11
Also, I'm using Ranorex.Libs.dll which also contains (sinse 4.0.2) Newtonsoft.Json of some another version, due to that I have a lot of problems with my project.

I can't just stop using Newtonsoft.Json v4.5.11 and use yours one.

How can I resolve this issue or could you please fix it somehow?

(we have bought licenses for 4.0.x but can't use 4.0.x at the moment because of that issues)

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 4.0.2 and Newtonsoft.Json

Post by Support Team » Tue Feb 26, 2013 4:19 pm

Hello,

Which kind of problems do you have in your project using the DLL?
Could you please send us the error message in order to analyze the issue in more detail? Are you sure that you use the right bit version of the DLL?
Thank you!

Regards,
Bernhard
.
Image

mgrybyk
Posts: 8
Joined: Fri Feb 22, 2013 12:19 pm

Re: Ranorex 4.0.2 and Newtonsoft.Json

Post by mgrybyk » Fri Mar 15, 2013 11:11 am

Hello, I've downloaded newtonsoft.json from here http://json.codeplex.com/releases/view/97986
and simply included Bin\Net40\Newtonsoft.Json.dll from there

and, I'm using Ranorex 32-bit dlls:
Ranorex.Libs
Ranorex.Plugin.Web
Ranorex.Core

Here are error messages types

Error 12 No overload for method 'Value' takes 0 arguments

Code: Select all

[language=csharp]
JObject jObject = JObject.Parse(response.streamResponse); //some repsonse
JToken groupList = jObject["groupList"]; //some obj
var someValue = groupList[0]["name"].Value<string>(); //here we have: No overload for method 'Value' takes 0 arguments
[/language]
one more types:
Error 4 Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'
have no idea what is it.
Warning 10 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'Ranorex.Libs.dll'

p.s.
sorry to say I can't Ranorex Studio project file as far as I don't use it. I work in MSVS2010

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 4.0.2 and Newtonsoft.Json

Post by Support Team » Tue Mar 19, 2013 2:42 pm

Hello,

Please find some ideas below:

Error 12:
Please try to debug your stored objects for solving this issue.

Error 4:
This error message could mean a number of different things.
You could try to remove this reference and add it again e.g.
Please take a look at this post at stackoverflow.

Warning 10:
You would need to add a specific alias for your library since Newtonsoft.Json is included in Ranorex.Libs as well. If you don't need Ranorex.Libs you could simply delete it.
Otherwise please add an alias for Ranorex.Libs and use it as described in our blog:
http://www.ranorex.com/blog/using-ranor ... me-project

Regards,
Markus (T)
.
Image

mgrybyk
Posts: 8
Joined: Fri Feb 22, 2013 12:19 pm

Re: Ranorex 4.0.2 and Newtonsoft.Json

Post by mgrybyk » Tue Mar 19, 2013 6:07 pm

Thanks! That help a lot and resolved my issue:

I've added alias for standard Newtonsoft.Json.dll

Code: Select all

[language=csharp]
extern alias NewtonJSON;
using NewtonJSON.Newtonsoft.Json;
using NewtonJSON.Newtonsoft.Json.Linq;
[/language]
according to http://www.ranorex.com/blog/using-ranor ... me-project

and, finally managed to exclude Ranorex.Libs from my project.

P.S.
I removed custom alias from reference to Newtonsoft.Json.dll after Ranorex.Libs had been excluded from project.

That's all! Thanks again.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex 4.0.2 and Newtonsoft.Json

Post by Support Team » Wed Mar 20, 2013 9:12 am

Hello,

You are welcome :-)

Regards,
Markus (T)
.
Image