After upgrading to lastest version of UiPath studio and publishing the library directory.getcurrentdirectory returns .nuget folder path that to of the library itself not the caller’s from where it is called any solution?
Hi @Rohit_Nandwani,
After the upgrade this is expected behavior. Libraries run from the NuGet cache, so Directory.GetCurrentDirectory returns the .nuget path of the library, not the caller project path. There is no fix for this. The correct solution is to pass the base path from the calling workflow to the library as an argument or use a predefined path from config or assets instead of GetCurrentDirectory.
This is expected. To access, resolve the path in the workflow and pass it in the library as argument.
I have a common library which is called by many processes now passing argument will need change at every place where it is called any other solution apart from this?
After publishing libraries, Directory.GetCurrentDirectory returns the .nuget package path by design; try to passing the caller’s working directory via arguments, Orchestrator assets, or configuration instead of relying on GetCurrentDirectory.
UiPath Documentation – About Libraries
Happy Automation
if data/output folder is needed in reusable thenpass it from poject as below…what you mentioned above also would work but better to pass as below
Path.Combine(Environment.CurrentDirectory,"Data","Output")
Make sure you pass it from the project xaml only and not use it directly in library or reusable…
Maybe you are looking for this:
