JSON Issues

Ask general questions here.
rezme
Posts: 15
Joined: Thu Feb 20, 2014 8:40 pm

JSON Issues

Post by rezme » Wed Mar 08, 2017 4:58 pm

Not sure if this is the right board to post to, so if the post needs to be moved, I understand.

I'm working with an existing automation project that has been working fine. We've got it linked to testrail, and are able to post results there via JSON with no issues (prior to this). Recently, a part of our product that uses JSON updated and delivered a new version of the newtonsoft.json.dll file. The old version we have is 8.0, and the new version is 9.0.

First, I simply replaced the dll in our dll repo (we keep a centralized folder with all library dlls in it, because our projects are highly library dependent) and refreshed the ranorex project. I subsequently got this error when attempting to run the same modules:

Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


I tried removing the reference entirely, and readding it, no luck. After finding this solution http://stackoverflow.com/questions/2250 ... ture-neutr, I tried adding the following to the app.config

Code: Select all

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"
        culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
No luck, same error.

I tried removing the JSON dll, and adding the package via NuGet, and I get an error in the package manager stating "microsoft.csharp already has a dependency defined for system.dynamic.runtime"

I've even done a search within every text based file in the ranorex project directory, attempting to locate any references to that dll file in any odd file, and was only able to find references in the reports files to the "file not found " exception generated when ranorex fails to find the 9.0 dll.

What I need to know, is how do I remove the stale reference to the 8.0 version of the JSON dll so that Ranorex will see the 9.0 version?

User avatar
N612
Posts: 62
Joined: Mon Jul 11, 2016 4:01 pm

Re: JSON Issues

Post by N612 » Fri Mar 10, 2017 5:26 pm

Based on my research, this is a bug in the older version of Nuget that Ranorex uses. I have already submitted this issue to Ranorex.

To bypass this issue, open your Ranorex project in VS, add the package, then reload your project in Ranorex Studio.