MSBUILD fails: "The process cannot access the xxxxx file because it is being used by another process." when maxcpucount is greater than 1

I am trying to improve the build time with CruiseControl.NET and MSBUILD, and one of the maxcpucount command line switches can be used for parallel build. Our solution has more than 60 projects, so any improvement would be useful. However, when I raise maxcpucount above one, we often have build failures due to:

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

It seems that the additional threads / processes of the parallel assembly are blocking each other.

+6
source share
3 answers

I think I found a solution. It looks like if I add the / nodeReuse: false switch, I don't get file locks. The nodeReuse function seems to support msbuild processes, and they depend on file locks for subsequent builds.

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

+3
source

Are you building a solution file? If so, be sure to use direct links to the project, and not use the project-project dependency function. If you use a little, both may cause problems. See this article .

Even better, if at all possible, cut out the solution file and create your own MSBuild file to create your assembly.

+2
source

Your assembly is probably being used by another assembly that is being built. Ensure that each assembly is built before other assemblies need it.

0
source

Source: https://habr.com/ru/post/893655/


All Articles