Error ERROR Validation Error CS0012: The type 'Dictionary<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections, Version=6.0.0.0, Culture=neutral, PublicKeyToken=XxxxxX. yyy.xaml

With C# !
This is definitely some bug in Studio , I’ve downloaded all the System.Collections, it wasn’t working this way TransactionItem.SpecificContent[“XxxxxX”].ToString(), then i tried with for each , of course it works but its not ideal way to go , so I delete it , i tried again TransactionItem.SpecificContent[“XxxxX”].ToString() it works just fine now …

Example Screenshot
Screenshot 2024-02-06 202611

Continuing the discussion from Reference to assembly 'System.Collections:

HI @Tiroski -

Use () bracket rather than [ ]

in_TransactionItem.SpecificContent("Your_Transcation_Field").ToString

Hi @ABHIMANYU_THITE1 Thanks for your tip but it is with C# not VB :confused: So that won`t help here :confused:

@Tiroski - for C# do the cast as per below.

(string)TransactionItem.SpecificContent["First Name"]

@Tiroski

Drag and drop an “Invoke Code” activity onto your UiPath workflow.
In the “Code” section of the activity properties, write your C# code.
Include the necessary using directive for System.Collections.Generic.
Here’s an example of how you can write code in the “Invoke Code” activity:

using System;
using System.Collections.Generic;

public class MyCode
{
public void Execute()
{
// Your C# code here
Dictionary<string, string> myDictionary = new Dictionary<string, string>();
// Perform operations with the dictionary
}
}

Weird … sometimes works, but mostly not …

So Guys thanks for your answers,I am solving that problem like this now, i`m creating an empty Variable from type → System.Collections.Generic.Dictonary<System.String, System.Object> , then all the Errors are gone … Im deleting that variable later , everythig works perfect , weird …

1 Like

Hello @Tiroski, Welcome to the UiPath community!

I noticed you might be using the UiPath Community version. Good news! UiPath has recently released version 2024.2.0, which includes a fix for the issue you’re facing. I recommend updating your Studio to this version and checking if it resolves your problem.

Cheers!

1 Like

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