Compilation bug (VS SLN, multithreaded) with Teamcity 7.04


In the TeamCity logs, sometimes I get the following error :

[All(no unittests, no setups).sln] Common\OP.SEEK.Common.Tools\OP.SEEK.Common.Tools.csproj: Build default targets (4s)

[17:00:55][Common\OP.SEEK.Common.Tools\OP.SEEK.Common.Tools.csproj] c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2079, 9): warning MSB3491: Could not write lines to file "C:\TeamCity\buildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.cs". The process cannot access the file 'C:\TeamCity\buildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.cs' because it is being used by another process.

Note that the compilation is multithreaded.
1 comment
Comment actions Permalink

Please check user account that you use to run build agent windows service.
You may check SysInternals Handle tool to know that process is locking the file.

This could turn out you use a task to generate build number.
The task may not be capable for concurrent execution as it creates a same-named file from each msbuild worker process.

Please check the script works properly on the build agent machine if you start msbuild.exe from console with /m parameter.


Please sign in to leave a comment.