Error when Deserialize Json Array

Getting the below error, with respect to Newtonsoft.Json.dll at two different locations, somehow the uipath workflow is referencing both the dll at two different locations and giving error, while Deserilize Json Array. Tried removing packages but they get installed with basic Activity pacakages of Uipath, and tried copying the same
Newtonsoft.Json.dll at both locations , Uipath application itself does not launch.

Request any inputs on solving this issue.It would be really helpful. Referred several topics in the forum with the related issue, but none is solving it.

RemoteException wrapping System.Exception: The invoked workflow ‘JsonExtract’ has validation errors. Please review the workflow and resolve the errors. —> RemoteException wrapping System.Activities.InvalidWorkflowException: The following errors were encountered while processing the workflow tree:
‘JsonExtract’: The private implementation of activity ‘1: JsonExtract’ has the following validation error: Compiler error(s) encountered processing expression “deserializedJson”.
Value of type ‘Newtonsoft.Json.Linq.JArray’ cannot be converted to ‘Newtonsoft.Json.Linq.JArray’. Type mismatch could be due to mixing a file reference to 'C:\Users\Dell.nuget\packages\newtonsoft.json\12.0.2\lib\net45\Newtonsoft.Json.dll’ in project ‘vbhost’ with a file reference to 'C:\Users\Dell\AppData\Local\UiPath\app-19.11.0-beta0002\Newtonsoft.Json.dll’ in project ‘vbhost’. If both assemblies are identical, try replacing these references so both references are from the same location.

at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.SimpleOperationAsyncResult.Run(TimeSpan timeout)
at System.Activities.WorkflowApplication.BeginRun(AsyncCallback callback, Object state)
at UiPath.Executor.RobotRunner.d__83.MoveNext()
— End of inner exception stack trace —
at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.SimpleOperationAsyncResult.Run(TimeSpan timeout)
at System.Activities.WorkflowApplication.BeginRun(AsyncCallback callback, Object state)
at UiPath.Executor.RobotRunner.d__83.MoveNext()

Can you post the JSON file which you are passing to the deserialize JSON activity?

json.json (6.2 KB)

Attached is the Json file. I am able to convert it to json String but when converting the JsonString to Json Object getting this error. Triedusing 1. ‘Deserialize Json’ activity getting error. 2. JsonConvert.Deserialize it is working converting to object but unable to extract values from that object as it is not a Json Object.

@mailsmithash

If you see, your JSON is an array. So, you need to use Deserialize JSON Array activity to deserialize. then the process is same to get the required data

Even using Deserialize Json Array getting the same error with Newtonsoft.Json.dll file. exactly the same error

Value of type ‘Newtonsoft.Json.Linq.JArray’ cannot be converted to ‘Newtonsoft.Json.Linq.JArray’. Type mismatch could be due to mixing a file reference to ’ C:\Users\Dell.nuget\packages\newtonsoft.json\12.0.2\lib\net45\Newtonsoft.Json.dll’ in project ‘vbhost’ with a file reference to ’ C:\Users\Dell\AppData\Local\UiPath\app-19.11.0-beta0002\Newtonsoft.Json.dll’ in project ‘vbhost’. If both assemblies are identical, try replacing these references so both references are from the same location.

Can you try using this workflow and let me know if you still get the same error

Carlor(Autosaved).xaml (5.6 KB)

make sure you have changed the path of the JSON file in the workflow and you need to install the packages required

Getting the same error with the file that you have sent.

Getting the same error.

Not sure about the issue, Can you try creating a new project and do it from the scratch leaving all this :slight_smile:?

Its working if i create a separate new project in Uipath. Thanks.

Apparently the issue was being caused by one of Packages that i had installed through the Manage Packages HealthCare.CMSData.Activites , if i install it again it gives the same error. On uninstalling this package, the Json serialization works fine.
Thanks a lot for the suggestion provided. It really helped.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.