为什么我的CruiseControl.Net字段在构建脚本中不可用?

为什么我的CruiseControl.Net字段在构建脚本中不可用?,.net,msbuild,cruisecontrol.net,msbuild-4.0,.net,Msbuild,Cruisecontrol.net,Msbuild 4.0,我有一个.NET4.0项目,我希望在CruiseControl.Net中构建它 它现在已经设置好了,所以它构建了一个发布版本,除了版本号(我不能引用CCNetLabel)之外,它工作得非常好,我希望使用它作为版本号的最后一位数字 当我尝试引用字段/变量时,我被告知它是未知的 看起来CC.Net并没有将这些值“转移”到我的脚本中,但我做错了什么 在ccnet.config和product-ci.config下面 谢谢你的建议 丹麦安德斯 <cruisecontrol xmlns:cb="ur

我有一个.NET4.0项目,我希望在CruiseControl.Net中构建它

它现在已经设置好了,所以它构建了一个发布版本,除了版本号(我不能引用CCNetLabel)之外,它工作得非常好,我希望使用它作为版本号的最后一位数字

当我尝试引用字段/变量时,我被告知它是未知的

看起来CC.Net并没有将这些值“转移”到我的脚本中,但我做错了什么

在ccnet.config和product-ci.config下面

谢谢你的建议

丹麦安德斯

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <cb:include 
        href="configs/product-ci.config" 
        xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>

<cb:scope xmlns:cb="urn:ccnet.config.builder"
    CCNetWebServer="dkapp04"
    TriggerInterval="10"
    WorkingDir="d:\ccnet.output\product"
    msBuildTargets="Publish"
    excludedNunitCategories=""
    publishUrl="http://dkapp04/product/Dev/"
    destinationFolder="d:\ccnet.output\product\Dev"
    version ="1.0.0.${CCNetLabel}"
>
  <project
   name="product"
   webURL="http://$(CCNetWebServer)/ccnet/server/local/project/product-ci/ViewLatestBuildReport.aspx"
   queue="default">

    <state type="state" directory="C:\Program Files\CruiseControl.NET\server\States\" />

    <triggers>
      <intervalTrigger seconds="$(TriggerInterval)" />
    </triggers>

    <sourcecontrol type="svn">
      <trunkUrl>https://dkapp04.company.com/svn/product/trunk</trunkUrl>
      <workingDirectory>$(WorkingDir)</workingDirectory>
      <cleanCopy>false</cleanCopy>
      <executable>C:\Program Files\VisualSVN Server\bin\svn.exe</executable>
    </sourcecontrol>

    <tasks>
      <msbuild
        executable = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
        workingDirectory = "$(WorkingDir)\src"
        projectFile="BuildScript.proj"
        buildArgs = "/p:Configuration=Debug /p:excludedNunitCategories=$(excludedNunitCategories) /p:DestinationFolder=$(destinationFolder) /p:PublishUrl=$(publishUrl) /p:ApplicationVersion=$(version)"
        targets = "$(msBuildTargets)"
        timeout = "100"
        logger = "C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"
          />
    </tasks>
  </project>
</cb:scope>

https://dkapp04.company.com/svn/product/trunk
$(工作目录)
假的
C:\Program Files\VisualSVN Server\bin\svn.exe

CCNetLabel作为属性传递给MSBuild项目文件,并可在其中使用。我使用默认值像这样使用它

<PropertyGroup>
<CCNetLabel Condition="$(CCNetLabel)==''">0.0.0.0</CCNetLabel>
</PropertyGroup>

0.0.0.0

嗨,普拉蒂克,谢谢你抽出时间。不过,我需要更多的帮助。我现在已经下载了svnRevisionLabeller,它像一个符咒一样工作。我得到了我想要的修改。发布的版本仍然是源文件中写入的1.0.0.3(并显示在VS中)。如何使其成为msbuild的最后一步?我似乎找不到合适的参数…我的解决方案如下-我的行中没有版本参数。谢谢你的帮助,安德斯