UiPath Pitfall #2: Keeping Your Studio Project in a OneDrive Sync Folder
UiPath Pitfall #2: Keeping Your Studio Project in a OneDrive Sync Folder
If you’re getting vague compile errors like a bare Error code 1, or a project runs on one PC and won’t open cleanly on another, check where the project folder lives. If it’s inside OneDrive or any always-sync cloud folder, that’s very likely your problem.
如果您遇到诸如“错误代码 1”之类的模糊编译错误,或者项目在一台电脑上运行正常但在另一台电脑上无法正常打开,请检查项目文件夹的位置。如果它位于 OneDrive 或任何始终同步的云文件夹中,这很可能就是问题的根源。
The mistake: Putting the live Studio project folder inside OneDrive (or Dropbox, or any folder that syncs all the time) so you can “share” it between machines. It feels convenient. It isn’t.
错误做法:将正在使用的 Studio 项目文件夹放在 OneDrive(或 Dropbox,或任何始终同步的文件夹)中,以便在不同机器之间“共享”。这看起来很方便,但实际上并非如此。
Why it bites: Studio writes a lot of files while you work: project.json, generated files, and a local cache in the hidden .local folder. A sync client can lock those files, leave some of them online-only, or still be downloading subfolders when Studio tries to compile. On the forum that usually shows up as a bare Error code 1, or a project that works on PC1 and won’t open on PC2 until someone copies it out of OneDrive. Network and shared drives cause the same kind of pain. Copy the project to a real local disk and it suddenly works.
为什么会出问题:Studio 在工作时会写入大量文件:project.json、生成的文件以及隐藏的 .local 文件夹中的本地缓存。同步客户端可能会锁定这些文件,将其中一些文件设为“仅在线”,或者在 Studio 尝试编译时仍在下载子文件夹。在论坛上,这通常表现为“错误代码 1”,或者在 PC1 上运行正常的项目在 PC2 上无法打开,直到有人将其从 OneDrive 中复制出来。网络驱动器和共享驱动器也会导致同样的问题。将项目复制到真实的本地磁盘,问题往往会迎刃而解。
The fix: 1. Keep the working project on a local path. Studio’s default location is: %USERPROFILE%\Documents\UiPath. But watch out: if Windows has redirected Documents into OneDrive, that default is a synced folder too. In that case put your projects somewhere that isn’t synced, for example: C:\UiPathProjects\
解决方法:1. 将工作项目保存在本地路径中。Studio 的默认位置是:%USERPROFILE%\Documents\UiPath。但请注意:如果 Windows 已将“文档”重定向到 OneDrive,则该默认位置也是一个同步文件夹。在这种情况下,请将项目放在未同步的位置,例如:C:\UiPathProjects\
-
Share and version with Git, not by syncing the live folder. In Studio, go to the Team tab and use GIT Init to add the project to a local Git repository, commit, then push to a remote. TFS and SVN are also supported if that’s what your team uses. Studio leaves the .local folder out of source control by default, so your machine cache stays off the repo.
-
使用 Git 进行共享和版本控制,而不是同步实时文件夹。在 Studio 中,转到“团队”选项卡并使用 GIT Init 将项目添加到本地 Git 存储库,提交并推送到远程仓库。如果您的团队使用 TFS 或 SVN,它们也同样受支持。Studio 默认会将 .local 文件夹排除在版本控制之外,因此您的机器缓存不会进入存储库。
-
Need a cloud copy just for backup? Zip or copy the project after you close Studio. Just don’t develop inside the synced folder.
-
需要云端备份副本吗?请在关闭 Studio 后压缩或复制项目。切勿在同步文件夹内进行开发。
-
Don’t confuse this with Sync to Cloud. Studio’s Sync to Cloud option syncs your project with Studio Web in Automation Cloud. It has nothing to do with OneDrive.
-
不要将其与“同步到云端 (Sync to Cloud)”混淆。Studio 的“同步到云端”选项是将您的项目与 Automation Cloud 中的 Studio Web 进行同步,这与 OneDrive 无关。
Quick check: Open File Explorer on your project path. If you see OneDrive sync icons on project.json or your workflow files, move the project to a local folder before your next publish.
快速检查:在文件资源管理器中打开您的项目路径。如果您在 project.json 或工作流文件上看到 OneDrive 同步图标,请在下次发布前将项目移动到本地文件夹。