【问题标题】:TFS SourceDirectory of EnvironmentVariable is always emptyEnvironmentVariable 的 TFS SourceDirectory 始终为空
【发布时间】:2017-07-22 07:24:35
【问题描述】:

我正在设置 TFS 以发布 WPF 项目。为了设置发布,我尝试通过 GetEnvironmentVariable Activity 从 EnvironmentVariable 获取 SourceDirectory 并加载到变量中。但是 SourceDirectory 总是变空。

SourceDirectory 是否默认出现,我是否应该设置一些东西以使 SourceDirectory 显示在 EnvironmentVariable 中?谢谢。

【问题讨论】:

  • 你在哪里设置这个,在你的项目中,在构建定义中,还是在构建模板中?
  • 感谢您的回复。我正在创建自定义构建模板...

标签: wpf visual-studio-2013 tfs


【解决方案1】:

我这样做是为了修改构建模板,因此我将初始化构建目录和二进制子文件夹,如下所示:

<mtbwa:GetBuildDirectory DisplayName="Get the Build Directory" 
                         Result="[BuildDirectory]" />

<Assign x:TypeArguments="x:String" 
        DisplayName="Initialize Binaries Directory" 
        To="[BinariesDirectory]" 
        Value="[String.Format(&quot;{0}\Binaries&quot;, BuildDirectory)]" />

然后你可以像这样复制输出的二进制文件:

<mtbwa:CopyDirectory Destination="[CopyToFolder]" Source="[BinariesDirectory]" />

“BuildDirectory”和“BinariesDirectory”变量声明如下:

<Variable x:TypeArguments="x:String" Name="BuildDirectory" />
<Variable x:TypeArguments="x:String" Name="BinariesDirectory" />

【讨论】:

  • 太棒了!我不知道 GetBinariesDirectory 活动。谢谢!!我的意思是 GetBuildDirectory :-)
猜你喜欢
  • 2014-01-14
  • 1970-01-01
  • 1970-01-01
  • 2017-07-31
  • 2019-07-18
  • 2019-08-18
  • 2011-12-29
  • 2019-07-02
  • 2019-05-04
相关资源
最近更新 更多