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:
- Close UiPath Studio
- Via File Explorer, navigate to the %userprofile%/.nuget/ folder and rename the packages folder. Example - packages_old. (This serves as a backup)
- 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.)
- When the project opens, open Manage Packages
- Install the desired dependency packages
- 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.
- The version of Studio and of the dependency package where the activity comes from
- A zipped copy of the project where the issue is occurring
- Run the UiPath Diagnostic Tool on the affected computer and share the report.