JToken - method is not a member?

I’m parsing some JSON data in my code, using an “Invoke Code” block.
Here is the code I am using:

    Dim resultTokens As Newtonsoft.Json.Linq.JToken = ecmResults.SelectToken("searchDocumentsResponse").SelectToken("documentsIndexInfo")
Dim resultChildren As Newtonsoft.Json.Linq.JEnumerable(Of Newtonsoft.Json.Linq.JToken) = resultTokens.Children
Dim maxDateVal As Date = Date.ParseExact("1/1/1990", "M/d/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)

Dim curDateVal As Date
newestDocGuid = ""

For Each rch As Newtonsoft.Json.Linq.JToken In resultChildren
    Dim curGuid As String = rch.Item("guid").ToString()
 Dim curObjectStore As String = rch.Item("objectStore").ToString()
    Dim jtok As IEnumerable(Of Newtonsoft.Json.Linq.JToken) = rch.SelectTokens("properties")

    For Each jt As Newtonsoft.Json.Linq.JToken In jtok.Children

        If jt("name").ToString() = "ReceivedOn" Then
            Dim curDateStr As String = jt("value").ToString()
            curDateVal = Date.ParseExact(curDateStr, "M/d/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
        End If
        If jt("name").ToString() = "Form_ID" And (jt("value").ToString() = "FORM1" Or jt("value").ToString() = "FORM2") And Date.Compare(curDateVal, maxDateVal) > 0 Then
                newestDocGuid = curGuid
       			maxDateVal = curDateVal 
       			newestObjectStore = curObjectStore
        End If


This code runs correctly in Visual Studio, however when running in UiPath Studio, I receive a message “Children” is not a member of Systems.Collections.Generic.IEnumerable(Of Newtonsoft.Json.Linq.JToken) at line 15. This is double-weird since the UiPath autocomplete for the code clearly lists “Children” as one of the methods that can be used.

I’ve seen some topics on here about missing assemblies, but I’m not sure which one I would need to correct this issue. I am using UiPath 2017.1.6435

Any ideas how to correct this issue?

Most likely your are missing some imports, it is hard to help cause you are using such an old version of UiPath, your code is good in my latest version…

Give a try on import Newtonsoft.Json.Linq
Ensure that the dependencies to uipath.web.activities ist configured

Sometimes there is failing recognition of methods, members … so Close Open xaml /Studio as well

Newtonsoft.Json.Linq is already in the imports; restarting UiPath hasn’t resolved this either.

If you have this on your Visual Studio, take a look at all imports there and bring them over to uipath studio…

OK, i faced sometimes a similiar issue, and IT was really Boring, as IT was Not Fully replicable by me. But IT was looking Like internal some Imports were not resolved and so it was complaining in a Same manner.

Which webactivties Version are you referencing by the Project and by the Studio itself?

After much deliberation and effort, the problem turned out to be the file that was being parsed - there are two different formats that can be returned. I was able to make to variants of this code to be able to handle both.