Error When Dragging A New Activity Into A Workflow Exception Has Been Thrown By The Target Of An Invocation

How to resolve the error "Exception has been thrown by the target of an invocation. Could not load file or assembly" thrown when attempting to drag a new activity into a workflow?

Issue:

When attempting to drag an activity into a workflow, the error, "Exception has been thrown by the target of an invocation. Could not load file or assembly." occurs. See the example error below,

Root Cause: Possible corrupt package installed on the local machine.


Troubleshooting / Resolution: Try rebuilding the %userprofile%/.nuget/packages folder. To do so, follow these steps:

  1. Close UiPath Studio
  2. Via File Explorer, navigate to the %userprofile%/.nuget/ folder and rename the packages folder. Example - packages_old. (This serves as a backup)
  3. Reopen UiPath Studio and create a new blank project. (The packages folder will rebuild in the .nuget folder during this step. It may take some time for the folder to rebuild.)
  4. When the project opens, open Manage Packages
  5. Install the desired dependency packages
  6. Attempt to drag the desired activity into the new workflow.

After following the steps above, if the issue is still unresolved, share the following with UiPath Product Support.

  1. The version of Studio and of the dependency package where the activity comes from
  2. A zipped copy of the project where the issue is occurring
  3. Run the UiPath Diagnostic Tool on the affected computer and share the report.