.net Azure中不健康的实例

.net Azure中不健康的实例,.net,azure,visual-studio-2012,azure-configuration,.net,Azure,Visual Studio 2012,Azure Configuration,我有一个工作部署。 我已将以下内容添加到云服务角色的配置文件中: <Startup> Task commandLine="EnableCompression.cmd" executionContext="elevated" taskType="simple"></Task> </Startup> 将此发布到Azure时,我得到: Your role instances have recycled a number of times

我有一个工作部署。 我已将以下内容添加到云服务角色的配置文件中:

<Startup>
      Task commandLine="EnableCompression.cmd" executionContext="elevated" taskType="simple"></Task>
    </Startup>
将此发布到Azure时,我得到:

Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
Cmd文件具有“始终复制”属性。所以这应该没问题。 从配置中删除
标记时,成功

上述情况似乎无法实现部署

这是什么原因呢?
谢谢

确保startup命令的返回代码始终为零,否则azure将假定它失败并回收您的角色

您可以将“exit 0”作为最后一个命令添加到批处理文件中,以确保其退出时的成功代码为零


最有可能的情况是,该命令失败了,或者它确实成功了,但是返回码为非零,表示没有任何更改等

但它没有解决问题,它基本上隐藏了问题的原因。在最后添加“退出0”是否正确。@循环有时它是合适的。例如,在上面的场景中,appcmd的退出代码可以是非零,这意味着“此配置设置已应用”,因此您可以忽略它。“退出0”将禁止此代码。@但可能会发生配置设置错误的情况,在这种情况下,我们只是隐藏错误。这事发生在我身上。
Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.