元素<msbuild> </msbuild>上的意外属性“BuildInParallel”

时间:2010-06-29 16:27:10

标签: msbuild nant nantcontrib

我正在尝试在MsBuild上使用BuildInParallel选项。

我有一个NAnt&amp; NAntContrib脚本,例如

<project xmlns="http://nant.sf.net/release/0.90/nant.xsd" name="Css Manager Solution Build" ToolsVersion="3.5" default="deploy">

        <target name="clean" description="Delete all previously compiled binaries.">
            <delete>
                <fileset>
                    <include name="**/bin/**" />
                    <include name="**/obj/**" />
                    <include name="**/*.suo" />
                    <include name="**/*.user" />
                </fileset>
            </delete>
        </target>

      <target name="deploy" description="Build and deploy all targets.">
            <msbuild project="CssManager.sln" BuildInParallel="true">
                <property name="Configuration" value="${configuration}"/>
                <property name="OutDir" value="${bin.output.dir}"/>
            </msbuild>
      </target>

</project>

但我收到此错误消息:

Unexpected attribute "BuildInParallel" on element <msbuild>

请指教?

1 个答案:

答案 0 :(得分:2)

nant-contrib的MSBuild任务没有BuildInParallel属性。您必须使用Maxcpucount命令行参数。

<target name="deploy" description="Build and deploy all targets.">
  <msbuild project="CssManager.sln" BuildInParallel="true">
    <property name="Configuration" value="${configuration}"/>
    <property name="OutDir" value="${bin.output.dir}"/>
    <arg value="/maxcpucount:${environment::get-variable('NUMBER_OF_PROCESSORS')}"/>
  </msbuild>
</target>