【问题标题】:Slowcheetah app.config pass parameters to transform fileSlowcheetah app.config 传递参数到转换文件
【发布时间】:2014-11-09 01:21:33
【问题描述】:

我有以下转换文件 app.Release.config 来使用 SlowCheetah 转换我的 app.config。如何从TeamCity 传递BUILD_NUMBER,以便转换文件替换特定的xml 元素值。

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="MyApp.Data.Model" publicKeyToken="866d4a0fa0599fe0" culture="neutral" />
    <bindingRedirect name="MyApp.Data.Model.BR" oldVersion="0.0.0.0-$(BUILD_NUMBER)" newVersion="$(BUILD_NUMBER)" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
  </dependentAssembly>      
</assemblyBinding>

如果我对值进行硬编码,则 SlowCheetah 会进行转换。但是,我不知道如何将build_number 作为参数传递,以便对于每个构建,我都可以替换正确的版本。

【问题讨论】:

    标签: xslt visual-studio-2013 msbuild teamcity slowcheetah


    【解决方案1】:

    我找不到将参数传递给 slowcheetah 转换文件的方法。我正在使用 XmlPoke 任务来修改 app.config 的内容。

    我的答案可以在this link找到

    【讨论】:

      猜你喜欢
      • 2013-03-20
      • 2013-05-29
      • 2018-08-10
      • 2012-02-20
      • 2019-12-09
      • 2018-06-19
      • 1970-01-01
      • 2012-11-10
      • 2016-04-03
      相关资源
      最近更新 更多