Environment.CurrentDirectory changes after error in custom Library

Scenario: When a custom activity (from a library) throws an error, the Environement.CurrentDirectory changes from the project folder that uses the custom activity to the library folder. This causes any subsequent use of Invoke Workflow File in the main project to crash with error “Could not find a part of the path…”.

Steps to reproduce: Create a library with a custom activity and use Throw activity to exit with error. Use the custom activity inside a project in a workflow. Use Invoke Workflow File to invoke the workflow with the custom activity, surround the Invoke Workflow File activity with Try Catch and on catch use another Invoke Workflow Activity.

Current Behavior: Invoke workflow File activity crashes with error “Could not find a part of the path…”.

Expected Behavior: Invoke workflow File should work normally.

Studio/Robot/Orchestrator Version: 2018.3.2

Last stable behavior:
Last stable version:
OS Version: Windows 10
Others if Relevant: (workflow, logs, .net version, service pack, etc):

1 Like

I have found a workaround. Surround the custom activity with a Try Catch activity and on catch use Rethrow activity.

Any News to this error, does it still exist in Version 2020.x? I have the same issue and since we want to update to 2020 soon, I wonder whether I should just wait until the update is done

This is a known issue and will be most likely fixed in the next 2020.10 patch update.

1 Like

I can confirm that this issue should be fixed in 20.10.3 patch release.

Hi @loginerror I am facing the same issue in the current version of the release. When I use Custom Library components in parallel activity then all the InvokeWorkflow activities fail as the current directory is changed and the relative workflow paths are not found. Please help

Hi @birinder

Thanks for reporting. Would you mind also creating a ticket with our technical support in case this is an enterprise scenario? :slight_smile: