我注意到最初在VS2008中创建的项目不能使用nantcontrib msbuild任务进行编译。有一个解决方案,我见过here,但它似乎有点黑客,考虑到'MSBuildBinPath‘已被取消,我并不是很喜欢在VS2008中创建的每个项目文件上改变这个属性的想法。
除了将构建脚本更改为通过执行任务调用msbuild之外,是否有办法将msbuild任务指向特定版本的MSBuild?也许这是在为Nant的下一个版本做准备?
发布于 2009-07-29 18:55:38
还有另一种选择,直接调用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-03-09 15:57:18
使用this hack或升级到nant 0.86 beta-1 or newer
https://stackoverflow.com/questions/626774
复制相似问题