Exceptions in custom library overrides Environment.CurrentDirectory

Hi All,

I am experiencing odd behaviour with exceptions and our custom libraries.

The error that I’m seeing is as follows:

  1. An activity in a custom library throws an exception.
  2. The exception is caught by a workflow in the project
  3. The CurrentDirectory has been changed from the root of the project to the path to the library.

For example after the exception is thrown I’d expect the CurrentDirectory would be:

C:\Users\myUserName\My Documentst\UiPath\Project Name\EnterStudentComment.xaml

But in fact it is:

C:\Users\myUserName\.nuget\packages\flinders.foundation\2.0.3-alpha.1\lib\net45\EnterStudentComment.xaml

Has anyone else experienced this before and have a solution?

I’m currently working around the issue by calling the System.Environment.CurrentDirectory method, storing was is returned, executing the code, and then resetting it back by calling the System.IO.Directory.SetCurrentDirectory method in our test suite. But this isn’t a workable soluition long term.

I’m using UiPath Studio 2019.4.4 and the following Dependencies:

  • UiPath.Excel.Activities - 2.6.3
  • UiPath.Mail.Activities - 1.6.0
  • UiPath.System.Activities - 19.8.0
  • UiPath.UIAutomation.Activities - 19.7.0

Any thoughts anyone has will be most welcome

With thanks.

-Corey

2 Likes

Hi @techxplorer

Thanks for reporting! I think this issue is already being investigated.

1 Like

hey I’m facing the same issue. Any solution identified?

Hi @vinaynasani

I believe this issue was resolved since the 2019.10 version of Studio. Note that you will need to republish your library to benefit from the fix.

Makes sense. Thanks Maciej!