【问题标题】:How to get value of argument in Build Process Template如何在构建过程模板中获取参数的值
【发布时间】:2014-01-14 21:20:07
【问题描述】:

我正在编写自定义构建过程模板,并面临以下与输入参数值相关的问题。请帮忙。

  1. 克隆了 StandardTemplate.xml 并重命名为 CustomTemplate.xml
  2. 添加名为 BatFileLocation 的新参数
  3. 尝试将 BatFileLocation 的参数值显示为如下代码

    // 定义一个字符串类型的活动输入参数

    public InArgument<string> BatFileLocation { set; get; }
    
    protected override void Execute(CodeActivityContext context)
    {
        // Obtain the runtime value of the Text input argument
        string text = context.GetValue(this.BatFileLocation);
        context.TrackBuildWarning(string.Format("Trigger the {0}", text));
    } 
    

但结果是 EMPTY 或 NULL。

【问题讨论】:

    标签: c# tfs build build-process


    【解决方案1】:

    通过重新映射客户活动的模板和输入参数的 VARIABLE 变量已解决该问题。

    步骤如下: - 右键单击​​刚刚添加到模板中的自定义活动 - 使用模板中声明的 VARIABLE 映射自定义活动的输入参数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-10
      • 2013-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多