Im trying to take the project name from CurrentDirectory
When I run a process from the studio
environment.CurrentDirectory looks like C:\Users\BOTname\Desktop\ProjectName
so I have
However when I run a process from the Orchestrator
environment.CurrentDirectory look like C:\Users\BOTname\.nuget\packages\ProjectName\1.0.7214.6145\lib\net45
How can I adjust my assign to have ProjectName instead on net45
Hi
Maybe I should add, once there is
C:\Users\BOTname\.nuget\packages\ProjectName\1.0.7214.6145\lib\net45
BOTname and ProjectName and package version is always different. I’m not sure if your solution will work
You could also chance the .Last to (5) to get the ProjectName but that only works if the directory structure stays like:
C:\Users\BOTname\.nuget\packages\ProjectName\1.0.7214.6145\lib\net45
The error sugests that split does not result in 6 or more parts,
for your local setup that is correct (“C:\Users\BOTname\Desktop\ProjectName” has only 5 parts) but for the production envirorment the path should contain more than 6 parts
the erro comes from the “\c” instead of the ""c
but in the end you would have to change the (5) every time you would switch directory structure (or dev to prod) so I am glad vickydas solution worked
Hello @niteckam if project name is all you need then why not to refer the project json file, located in project folder itself.
just read Project.json to string variable