System.IO.DirectoryNotFoundException: Could not find a part of the path

Hi @peaches

Would you mind creating a ticket with our Technical Support at this link?

Feel free to reference this topic in the ticket for extra context, but please provide a detailed description of your particular case.

Yes, I’ll make sure to do that :slightly_smiling_face:

1 Like

Hi Team,

We are in the same situation and also experiencing the above, was a resolution found for this @peaches ?

I haven’t yet made contact with technical support regarding this bug yet, but will do that very soon. However, here’s an example of the workaround solution that we are using at the moment. It’s basically the solution that @DanielaD suggested above. Sure does the job, but feels and looks a lot like duck taping your rusty old Nissan Micra.

As per this release notes:

It should be fixed in 2019.10.1, but you have to republish your libraries for the fixes to work:

We are actually experiencing this issue with libraries created for the first time in 2019.10.4, so the bug unfortunately still seems to be present in some scenarios. In our case, we have only bumped into this issue so far when using library activities in Pick/Pick branch activities. See example workflow below.

1 Like

Would you mind sending over this sample project that showcases the issue?

I will have a look.

Thanks for that @peaches & @loginerror,

We’ve found this happens where either a Parallel or Pick Branch Activity contains a library object using Find Element, we’ve set a Directory String variable for the project during init and passed this in as a check point during processing, if the directory has changed, use the set directory Method:

This stops it forcing this directory change regardless.

Hi @peaches, would be so kind and share the project you were using to replicate the issue? If you feel comfortable, you can send it via a private message to me or @loginerror. Thank you so much! :slight_smile:

I can confirm we’re noticing similar behavior with Enterprise licenses of Studio/Robot 2019.10.4. Our libraries and processes contain .gitignore files at the root project folder in order to ignore specific local files from being pushed to our git repositories; removal of these files in our libraries and processes isn’t feasible for that reason.

I see @The_Hutch’s example of using an Invoke Method to reset the current directory, but truth be told I’m uncertain where and how often to put these activities to reset the directory as I’m a bit mystified still on the actual root cause. I could put an Invoke Method to reset the directory between every called custom library action in our processes, but that seems profoundly unreasonable. I don’t seem to be able to reliably replicate this issue so it would be great if @peaches could give @coramia further guidance if they haven’t already done so.

Hoping we can get this issue permanently resolved without the need for the Invoke Method.

Hi @coramia ,

I just sent you and @loginerror an example process and library that demonstrates the bug.

/Peaches

2 Likes

Hi @peaches, thank you so much for the example workflow. We’ll investigate the issue and get back as soon as we determine anything relevant.

i faced the same issue yesterday from one of my old project. The project is working for 8 months for properly. Occurred in one of the 3 transactions that worked yesterday. And we are also having th UiPath Robot Version 2019.10.4

Hi @erkanceylan

Please do not hesitate to contact our technical support to be able to provide us more information about this issue and to have a way to track the progress:

1 Like

Im getting the same problem, that time with a 2020.10 robot version.
I will check for the files extension of my project and do the solution of saving the current directory.

I’m having the same issue with Studio 2021.10.5.
I’ve implemented the workaround for now and logged it with support.

  1. Workaround (if using the REFramework) is:
  2. Open Main.xaml and open “Process Transaction” state.
  3. Before the “Invoke ProcessTransaction workflow” activity add an “Assign” activity which assigns SavedCurrentDirectoryVariable=directory.GetCurrentDirectory
    image
  4. Go to the “Exception” catch for the “Try Catch” you are currently within and add an “Invoke Method” activity.
  5. Set the target type to “System.IO.Directory” (You may need to find it in “Browse for types…”)
  6. Set the Method Name to “SetCurrentDirectory”
    image
  7. In the “Properties” pane on the right of Studio click the “…” next to the parameters collection
  8. Create an “In” parameter as a “String” with the value as “SavedCurrentDirectoryVariable”

Hope this helps others having the same issue.

I know this is a dead thread, but I’ve encountered the same issue today. When a system exception has bubbled up through Process.xaml to the Process state machine and been caught, instead of invoking the SetTransactionStatus.xaml in the project, the bot has tried to invoke ‘Framework\SetTransactionStatus.xaml’ from one of the libraries within the project. That’s obviously failed with the IO.DirectoryNotFoundException as there is no STS workflow in the library and it’s orphaned the transaction and faulted the job.

This process has been live for over a year with tens of thousands of transactions, and this is the first time I’ve spotted it happen.

image

Correct location of STS: C:\Users{bot}.nuget\packages{project}{version}\lib\net45\Framework\SetTransactionStatus.xaml’
Attempted invoke: C:\Users{bot}.nuget\packages{library}{version}\lib\net45\Framework\SetTransactionStatus.xaml