开发者

MSBUILD fails with "The process cannot access the file xxxxx because it is being used by another process." when maxcpucount is greater than 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:

开发者_高级运维

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


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


Are you building from a solution file? If so, make sure that you are using direct project-to-project references and not using the Solution's project-dependency feature. If you happen to be using a bit of both, there can be issues. See this article.

Better yet, if at all possible, ditch the solution file and create your own MSBuild file to drive your build.


Your assembly is probably being used by another assembly thats being built. Make sure each assembly gets built before it's needed by other assemblies

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜