5

我有一个巡航控制服务器在虚拟机上运行构建。我所做的只是将源代码控制从Perforce更改为Git,并且构建失败。Cruise Control .Net异常写入msbuild-results.xml

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:\建立\ Pcp_Main \工件\存在和运行的版本的用户有写权限的文件夹。

我也试着改变日志dll到Rodemeyer.MsBuildToCCnet.dll,我得到相同的异常。

该项目也从命令行构建没有任何问题。

回答

6

问题是生成文件夹中的工件文件夹。将它移出构建文件夹可解决问题。

+0

正在遍寻此错误的计算器,但无法找到解决方案。现在我自己找到了它,并一直在寻找其他东西......并发现这......当生活给你柠檬..... – spankmaster79 2015-03-05 16:06:28

+0

很高兴这有助于人! – James 2015-03-05 22:11:14

+0

我们得到这个是因为在构建开始时,我们正在清理以前的版本,其中包括正在写入的MSBuild日志文件。哎呀。 – 2015-04-02 23:35:32