MSBUILD失败,并显示“该进程无法访问文件xxxxx,因为该文件正被另一个进程使用."当maxcpucount大于1时 [英] MSBUILD fails with "The process cannot access the file xxxxx because it is being used by another process." when maxcpucount is greater than 1

查看:152
本文介绍了MSBUILD失败,并显示“该进程无法访问文件xxxxx,因为该文件正被另一个进程使用."当maxcpucount大于1时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CruiseControl.NET和MSBUILD缩短构建时间,并且可以使用命令行开关之一maxcpucount来允许并行构建.我们的解决方案有60多个项目,因此任何改进都将有所帮助.但是,每当我将maxcpucount设置为大于1时,由于以下原因,我们经常会发生构建失败:

I'm trying to improve build times using CruiseControl.NET and MSBUILD, and one of the commandline switches, maxcpucount can be used to allow the build occur in parallel. Our solution has 60+ projects so any improvement would be helpful. However, whenever I up the maxcpucount above one, we have frequent build failures due to:

该进程无法访问文件xxxx,因为它正在被文件xxxx使用 另一个过程. msbuild"

"The process cannot access the file xxxx because it is being used by another process. msbuild"

其他并行构建线程/进程似乎相互锁定.

It appears that the additional parallel build threads/processes are locking each other.

推荐答案

我想我找到了解决方案.看来,如果我添加/nodeReuse:false开关,我不会得到文件锁.似乎nodeReuse功能使msbuild进程保持不变,并且这些进程都挂在文件锁上以进行后续构建.

I think I found a solution. It appears that if I add the /nodeReuse:false switch I don't get the file locks. It seems like the nodeReuse functionality is keeping msbuild processes around and those are hanging on to file locks for subsequent builds.

http://msdn.microsoft.com/en-us/library/ms164311.aspx

这篇关于MSBUILD失败,并显示“该进程无法访问文件xxxxx,因为该文件正被另一个进程使用."当maxcpucount大于1时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆