【问题标题】:Get Octopus Deploy release number from a C# WinForms app从 C# WinForms 应用程序获取 Octopus Deploy 版本号
【发布时间】:2014-09-26 08:57:13
【问题描述】:

我们使用 Octopus Deploy 来部署我们的应用程序。如果我的 WinForm 应用程序可以在运行时显示 Octopus Deploy 版本号,那将非常有用。

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

【问题讨论】:

    标签: c# winforms octopus-deploy


    【解决方案1】:

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

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

    然后你可以从代码中读取替换的值。

    【讨论】:

    • 啊,这比使用转换更干净!
    • 如果它至少可以工作,我只是从文档中拼凑出来的,不要在这里运行。
    • @Layoric 所以请随意取消删除您的答案,人们可​​能没有运行 Octopus 2.3,或者它甚至可能无法运行。 :)
    • 酷。我会先给它。谢谢
    猜你喜欢
    • 1970-01-01
    • 2014-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-18
    • 2016-01-14
    • 2011-09-11
    相关资源
    最近更新 更多