首页 > 解决方案 > 工具退出并显示消息“退出并返回代码:-1”

问题描述

我已经运行了该工具,并且它的执行方式非常完美。在迁移结束时,我收到以下消息“退出并返回代码:0”。

通常情况下,我不会打扰。但是,我正在使用 Azure DevOps 发布管道实现迁移。使用此消息,部署阶段总是失败。

有人对此错误有任何想法吗

The last few lines of execution
Migration Processor Complete TfsTeamSettingsProcessor
2021-04-23T07:12:23.4698310Z [07:12:23 INF] TfsTeamSettingsProcessor completed in 00:00:02.9601088
2021-04-23T07:12:23.4746613Z [07:12:23 INF] Application is shutting down...
2021-04-23T07:12:23.4787008Z [07:12:23 DBG] Hosting stopping
2021-04-23T07:12:23.4792590Z [07:12:23 DBG] Exiting with return code: 0
2021-04-23T07:12:23.4797995Z [07:12:23 INF] Terminating: Application forcebly closed.
2021-04-23T07:12:23.4802683Z [07:12:23 INF] Application Ending

标签: azureservicedevops

解决方案


看起来 robocopy 退出代码 0-7 表示成功。我从命令行执行更改为 powershell 命令,并将其添加到脚本的底部:

if ($lastexitcode -lt 8) { $lastexitcode = 0 }

这对我有用。


推荐阅读