Customized activity doesn't work on virtual machine

Hi UiPath community,

I am facing a major problem.
Indeed, I developed a program with a customized activity for a project. My program run perfectly on my machine.
However, when I run it on my VM, the program run perfectly except for this customized activity.
Do you have any idea to resolve this problem?
Thanks at all

Hi @MigT,
Probably there is a lack o package on robot side. How is your robot on VM configured? Are you using Orchestartor?

Please also find some information here:

Hi @Pablito,

I checked again and all dependency packages are installed too on my VM.
Also, I paste the nuget file of the custom activity in “packages” folder of UiPath.

On my VM, I tried tu run the robot from Studio and Orchestrator, and the problem is on the same part of the program.

HI @MigT

What’s the error that you are getting from the custom activity that you have included in the workflow?

and what type of a task does it perform?

Hi @Lahiru.Fernando,

The error is “The given key was not present in the dictionary” .

The aim of the task is, according to the candidate’s profile information the program should:

  • change the tokens
  • delete (or not) some paragraphs
    … to edit a contract

based on the error, it looks like it is accepting some dictionary variable with some values. And whatever the key it is looking for inside, is not available in the dictionary. You might need to check what values are available in the dictionary variable at the run time to make sure whether that key is available or not, and if not, why…

The best way to figure that out is to use the debug mode. Have a break point on the activity by right clicking on it and selecting toggle break point. Then run the program from the beginning in debug mode. Once the execution gets there, see what values you have in the dictionary to make sure the key it is looking for, is present in the dictionary…

Let me know how it goes…

1 Like

sure I did it, and it seems that the contract code is missing but I don’t know why because all elements are similar to my machine. That’s why I don’t understand the reason of this problem.

On my machine:
not%20VM

On my VM:
VM

1 Like

@MigT

From where is the contract code extracted from? Web page or something else? You might need to use the same approach on the activities which you have used to extract those values. This way you will be able to track what is actually going wrong.

If it’s a web page, enable the element highlighting from the top ribbon so that you can see what elements are identified and used…

1 Like

The contract is in the package, I checked and on the machine and VM, the program found the good location. The variable “ContractCode” is the outpout of the customed activity.
ok I will check again, I had to miss a little detail.

2 Likes

Very strange, the only difference is the “contract code” variable value that is empty on VM compare to my machine.
Alse for a reason that escapes me, the name of the activity is different on the studio VM compared to the studio of my machine. Yet, the .nuget package is the same

@MigT
It should not be an issue with Package installation or update as you are not getting exception while initiating package. If i understand correctly, your package is doing some functionality where this error is thrown. Can you add more logs into your custom code and see where the error is been thrown?
Or is it possible to share your custom activity code?

Sure, this is the details of the error message:
RemoteException wrapping System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at NovelConseil.RPA.Uipath.POCIndia.EditContract.MappingKeys(Dictionary`2 infoList, ScriptObject scriptObject)

at NovelConseil.RPA.Uipath.POCIndia.EditContract.Execute(CodeActivityContext context)

at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hello @Madhavi, @Lahiru.Fernando, @Pablito and everyone,

Since the last time, I didn’t found the solution to my problem.

To precise it’s only when the program should to trigger my customized activity. The code is exactly the same, work on user machine but not on my VM. I tried on an other VM, and I have the same result.
You could see below the error message with details and the code on visual studio. With that are you able to tell what’s wrong?

Thanks a lot

Error%20message

Error message in attach file, and below the details :

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at XXXXXXX.RPA.Uipath.XXXXX.EditContract.MappingKeys(Dictionary`2 infoList, ScriptObject scriptObject)

at XXXXXXX.RPA.Uipath.XXXXX.EditContract.Execute(CodeActivityContext context)

at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)