观察到的行为
After converting a Robot from Service-Mode to User-Mode, the XML files in the NuGet Packages aren't accessible after the migration is complete and the following error message is displayed:
“拒绝访问路径 C:\Users\john.doe\.nuget\packages\HelloWorld\1.0.0\lib\net45\Main.xaml
”。
原因
在服务模式下部署机器人时,机器人运行服务所在的本地系统会下载包并将其安装在文件夹中(例如 .nuget\packages
)。
转换为用户模式后,该文件夹中的 NuGet 包将无法再访问,因为运行机器人的当前用户无权查看或编辑这些文件。
解决方案
1. 删除原始文件夹中的所有包:
如果选择从原始文件夹中删除包,则机器人将在用户许可下重新安装已配置文件夹中的流程。通过这种方式,机器人可以在需要运行文件时随时访问这些文件。
2. 更改包文件夹:
When converting the Robot from Service-Mode to User-Mode, you can change the packages installation folder from %userprofile%\.nuget\packages
to a different path, like %userprofile%\.nuget\packages_new
.
默认情况下,活动包已下载并安装在 %userprofile%\.nuget\packages
文件夹中。您可以通过以下方式之一设置其他文件夹:
-
During installation, by installing from the command line with the option
PACKAGES_FOLDER
. -
安装完成后,通过手动编辑
uipath.config
文件:- 在文本编辑器中打开
uipath.config
文件。默认情况下,该文件位于C:\Program Files\UiPath\Studio
。 - 在
packageSettings
节点中,添加packagesInstallationFolder
键,并将新文件夹的路径作为其值。 - 保存更改并重新启动机器人。
例如,将以下代码添加到
uipath.config
以将下载位置更改为C:\nuget
。 - 在文本编辑器中打开
<packageSettings>
<add key="packagesInstallationFolder" value="C:\nuget" />
</packageSettings>
For more details around the differences between Service-Mode and User-Mode Robots, read the according to deployment document which provides a more detailed description of each type of Robot.
Updated 17 days ago