2014-09-26 99 views
1

我们使用Octopus Deploy部署我们的应用程序。如果我的WinForm应用程序可以在运行时显示Octopus Deploy版本号,这将非常有用。获取Octopus从C#WinForms应用程序部署版本号

是否可以设置Octopus Deploy,以便将存储在app.config中的变量设置为Octopus.Release.Number系统变量,以便我可以在运行时检索版本号?

回答

1

根据Variable substitution in files with Octopus 2.3System Variables您可以:

  • 使用<add key="OctopusReleaseNumber"value="#{Octopus.Release.Number}" />在你的配置
  • 启用变量替换
  • 配置本作相应的配置文件

然后你可以阅读代码中的替代值。

+0

啊,这是一个比使用变换更清洁的解决方案! – 2014-09-26 09:19:15

+0

如果它至少起作用,我只是将它们从文档中拼凑出来,不要在这里运行。 – CodeCaster 2014-09-26 09:19:53

+0

@Layoric因此随时取消删除您的答案,人们可​​能不会运行八达通2.3,否则它可能无法正常工作。 :) – CodeCaster 2014-09-26 09:34:16