nant中设置使用哪个版本的MSBuild的配置设置在哪里?
当Nant需要使用4.0时,它希望使用3.5。
发布于 2012-06-20 00:32:59
几年前,我写了一篇博客,解释了如何从NAnt构建脚本中利用任何版本的MSBuild。实际上,当MSBuild安装在您的计算机上时,您将使用<exec>节点调用它。
http://enterpriseyness.com/2009/12/continuous-integration-with-cruise-control-net-nant/
<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>发布于 2014-01-01 03:13:43
您还可以创建NAnt框架配置。如果编辑NAnt.exe.config文件,请复制其中一个<framework>元素及其所有子元素。更改frameworkdirectory以使用您要使用的MSBuild的版本号。您可以查看其他<framework>元素的正确用法。例如,如果您想让'net-3.5‘<framework>元素使用MSBuild 4.0,只需更改复制的<framework>打开元素,如下所示:
<framework
name="net-3.5-msbuild-4.0"
family="net"
version="3.5"
description="Microsoft .NET Framework 3.5 with MSBuild 4.0"
sdkdirectory="${sdkInstallRoot}"
frameworkdirectory="${path::combine(installRoot, 'v4.0.30319')}"
frameworkassemblydirectory="${path::combine(installRoot, 'v2.0.50727')}"
clrversion="2.0.50727"
clrtype="Desktop"
vendor="Microsoft"
><!-- Rest of framework contents here --></framework>请注意frameworkdirectory属性中的不同版本号。
然后指定要在NAnt中使用的框架。
<property name="nant.settings.currentframework" value="net-3.5-msbuild-4.0" />https://stackoverflow.com/questions/11089407
复制相似问题