Is there any way to debug code written in "Invoke Code" line by line just like VB.NET code

Is there any way to debug code written in “Invoke Code” line by line just like VB.NET code?

To make more specific about my question above, I have written below Linq Query code in “Invoke Code” activity. It is giving error “Invoke code : Exception has been thrown by the target of an invocation.”

Through Linq query, I am trying get sum of column “Amount1” group by column “Column1”

Dim groups As IEnumerable(Of Decimal) = From j As Object In local_dtSelectedCustodianData.Rows
Where DirectCast(j, DataRow)(“Column1”).ToString.Trim.ToLower = “Val1”.ToLower
Group By x = New With {Key .AccID = DirectCast(j, DataRow)(“Column1”)} Into g = Group
Select g.Sum(Function(r) Convert.ToDecimal(IIf(DirectCast(r, DataRow)(“Amount1”) Is DBNull.Value, 0, DirectCast(r, DataRow)(“Transaction Amount Local”))))

							msgbox (groups.FirstOrDefault.ToString)
1 Like

And above code works perfectly well when I test it through VB.NET console application.