巡航控制(Cruise Control) .Net写入msbuild-results.xml时出现异常

5

我有一个在虚拟机上运行构建的巡航控制服务器。 我只是将源代码管理从Perforce更改为Git,现在构建正在失败。

CCNet配置

<tasks>
    <msbuild>
        <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <workingDirectory>c:\Build\Pcp_Main</workingDirectory>
        <buildArgs>/v:d Pcp.proj /target:Clobber;Build /property:Configurations="Debug;Release" /property:NUnitRedirectConsoleOutput=1</buildArgs>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
        <timeout>2700</timeout>
    </msbuild>
</tasks>

构建日志

Done Building Project "c:\Build\Pcp_Main\Pcp.proj" (Clobber;Build target(s)).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:32.39
MSBUILD : error MSB4015: The build stopped unexpectedly because the "ReusableLogger"   logger failed unexpectedly during shutdown.
System.IO.DirectoryNotFoundException: Could not find a part of the path  'c:\Build\Pcp_Main\Artifacts\msbuild-results-2d082e8c-0e88-4c0b-9a6b-aa0e3094cab9.xml'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Xml.XmlDocument.Save(String filename)
   at ThoughtWorks.CruiseControl.MSBuild.XmlLogger.Shutdown()
   at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.Shutdown()
   at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownLogger(ILogger logger)
</build>

文件夹c:\Build\Pcp_Main\Artifacts\存在,并且运行构建的用户有对该文件夹的写访问权限。

我还尝试将日志记录dll更改为Rodemeyer.MsBuildToCCnet.dll,但我得到了相同的异常。

该项目也可以在命令行中顺利构建,没有任何问题。

1个回答

6
问题是将构件文件夹放在构建文件夹中。将其移到构建文件夹之外解决了该问题。

我在 StackOverflow 上搜寻了很久,但是找不到解决方案。现在我终于自己找到了一个解决方法,正在寻找其他的内容时... 然后我发现了这个... 当生活给你柠檬时... - spankmaster79
很高兴这对某人有所帮助! - James Kessler
我们之所以出现这个问题,是因为在构建开始时,我们清理了先前的构建,其中包括我们正在写入的MSBuild日志文件。糟糕。 - Aaron Jensen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接