Relative path error

Hi,

This is usual behaviour - a process has one entry for working directory, for UiPath that’s supplied from the entry (starting) workflow.
You can change it with a Directory.SetCurrentDirectory call.

I’d actually recommend to restructure your folders and do a tree hierarchy, f.e.:

  • Root (contains Main.xaml and other high level workflows)
  • Root/Folder1 (contains Folder1 specific workflows)
  • Root/Folder2 (contains Folder2 specific workflows)

That way you can always use a path relative to the entry working directory, so you can move your whoel project to a different location without it braking. Explicit/full paths have a tendency to break on migrations/network changes, which is an issue that’s just waiting to happen in the future.

Alternatively, you could store the paths (or working directories paths) externally, f.e. in Orchestrator assets, and use that in a way similar to a configuration file.

Regards.

1 Like