0

我注意到最初在 VS 2008 中创建的项目不能使用 nantcontrib msbuild 任务进行编译。我在这里看到了一个解决方案,但考虑到“MSBuildBinPath”已被贬低,我不完全喜欢在我创建的每个项目文件上更改此属性的想法。与 2008 年相比。

除了更改构建脚本以通过 exec 任务调用 msbuild 之外,有没有办法将 msbuild 任务指向特定版本的 MSBuild?也许这正在为 Nant 的下一个版本准备?

4

2 回答 2

3

还有另一种选择,直接调用 MsBuild.exe。

这是一个例子:

<property name="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"/>    
    <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" />
        </exec>
    </target>

如果你从 Cruise Control .NET 调用 Nant,你也可以添加这个参数:

<arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/>
于 2009-07-29T18:55:38.023 回答
1

Either use this hack or upgrade to nant 0.86 beta-1 or newer

于 2009-03-09T15:57:17.883 回答