代码之家  ›  专栏  ›  技术社区  ›  Justin Rusbatch

从NAnt执行MSBuild并指定记录器时出错

  •  2
  • Justin Rusbatch  · 技术社区  · 14 年前

    <target name="compile">
        <property name="solution.file" value="${source.dir}\GS3WebSite.sln"/>
    
        <if test="${not file::exists(solution.file)}">
            <fail message="The solution file (${solution.file}) was not found." />
        </if>
    
        <mkdir dir="${output.dir}" if="${not directory::exists(output.dir)}" />
    
        <!-- Specify CC.NET's XML logger -->
        <property name="msbuild.xmllogger"
                  value="${ccnet.dir}\ThoughtWorks.CruiseControl.MsBuild.XmlLogger, ThoughtWorks.CruiseControl.MsBuild.dll"/>
    
        <exec program="${msbuild.dir}\msbuild.exe"
              commandline="${solution.file} /logger:&quot;${msbuild.logger}&quot;"
              workingdir="." failonerror="true" />
    </target> 
    

    执行此目标时,我收到以下错误:

    我认为这是因为在逗号前插入了反斜杠。有没有其他方法来说明这一点?或者我需要以某种方式避开逗号吗?

    1 回复  |  直到 14 年前
        1
  •  1
  •   Benjamin Baumann    14 年前

    我认为您颠倒了logger声明中的顺序,即:AssemblyPath,LoggerName和notloggername,AssemblyPath。
    所以你可以试试

     <!-- Specify CC.NET's XML logger -->
    <property name="msbuild.xmllogger"
              value="${ccnet.dir}\ThoughtWorks.CruiseControl.MsBuild.dll"/>