Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从NAnt执行MSBuild并指定记录器时出错_Msbuild_Cruisecontrol.net_Nant - Fatal编程技术网

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

从NAnt执行MSBuild并指定记录器时出错,msbuild,cruisecontrol.net,nant,Msbuild,Cruisecontrol.net,Nant,我试图从NAnt脚本(由CruiseControl.NET调用)执行MSBuild。由于我是从NAnt而不是从CC.NET调用MSBuild,因此我希望指定使用XmlLogger,以便仍然可以为CC.NET生成MSBuild报告。这是负责使用MSBuild构建解决方案的nant目标: <target name="compile"> <property name="solution.file" value="${source.dir}\GS3WebSite.sln"/&g

我试图从NAnt脚本(由CruiseControl.NET调用)执行MSBuild。由于我是从NAnt而不是从CC.NET调用MSBuild,因此我希望指定使用XmlLogger,以便仍然可以为CC.NET生成MSBuild报告。这是负责使用MSBuild构建解决方案的nant目标:

<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> 

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

[exec]MSBUILD:错误MSB1021:无法创建记录器的实例。无法加载文件或程序集“ThoughtWorks.CruiseControl.MsBuild.XmlLogger\、C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll”或其依赖项之一。给定的程序集名称或代码基无效。(来自HRESULT的异常:0x80131047)


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

我认为您颠倒了记录器声明中的顺序,即:AssemblyPath、LoggerName和not LoggerName、AssemblyPath。
此外,据我所知,如果程序集中只有一个logger类,则不需要指定logger类。 所以你可以试试

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