【问题标题】:How to rebuild solution using NAnt?如何使用 NAnt 重建解决方案?
【发布时间】:2010-12-22 04:56:05
【问题描述】:

我在 NAnt 构建文件中使用以下命令

<msbuild project="${appsdest}\${targetname}\${targetname}.sln"/>

appsdest 和 targetname 是包含应用程序项目路径的变量,targetname 是包含要重建的项目名称的变量。

但是当使用此命令时,它会构建解决方案,但 dll 的时间戳没有更新。

我需要重新构建解决方案,并且最新的 dll 需要放在调试文件夹中。

谁能告诉我如何使用上面写的 msbuild 命令重建解决方案?

谢谢

【问题讨论】:

    标签: nant rebuild


    【解决方案1】:

    我不使用 NAnt 中的 MSBUILD 任务,我只是直接调用 msbuild 可执行文件,它对我来说效果很好。

    <target name="build">
      <exec program="${MSBuildPath}">
        <arg line='"${SolutionFile}"' />
        <arg line="/property:Configuration=${SolutionConfiguration}" />
        <arg value="/target:Rebuild" />
        <arg value="/verbosity:normal" />
        <arg value="/nologo" />
        <arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/>
      </exec>
    </target>
    

    我在这里写了更多关于它的信息:http://enterpriseyness.com/2009/12/continuous-integration-with-cruise-control-net-nant

    【讨论】:

      【解决方案2】:

      您需要使用“重建”目标:

      <msbuild project="${appsdest}\${targetname}\${targetname}.sln" target="Rebuild"/>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-06
        • 1970-01-01
        相关资源
        最近更新 更多