Build hangs during MSBuild task


I'm using FAKE library for my build script and TeamCity 9.0.2.

Recently I've noticed, that sometimes, some builds, in some branches get stuck while building. I'm using this function to start MSBuild.

[20:52:03][Step 1/1] Target: Build [20:52:03][Step 1/1] Task: MSBuild MyProject.sln [20:52:03][Step 1/1] Building project: MyProject.sln [20:52:03][Step 1/1]   C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe  MyProject.sln /t:Clean;Build /m /nodeReuse:False /tv:12.0 /v:q  /p:Optimize="True" /p:DebugSymbols="True" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+TeamCityLogger,"C:\TeamCity\buildAgent3\work\f6172ce9e725797a\packages\FAKE\tools\FakeLib.dll" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\TeamCity\buildAgent3\work\f6172ce9e725797a\packages\FAKE\tools\FakeLib.dll" [20:52:03][Step 1/1] C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe  MyProject.sln /t:Clean;Build /m /nodeReuse:False /tv:12.0 /v:q  /p:Optimize="True" /p:DebugSymbols="True" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+TeamCityLogger,"C:\TeamCity\buildAgent3\work\f6172ce9e725797a\packages\FAKE\tools\FakeLib.dll" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\TeamCity\buildAgent3\work\f6172ce9e725797a\packages\FAKE\tools\FakeLib.dll" [20:52:03][Step 1/1] Microsoft (R) Build Engine version 12.0.21005.1 [20:52:03][Step 1/1] [Microsoft .NET Framework, version 4.0.30319.18449] [20:52:03][Step 1/1] Copyright (C) Microsoft Corporation. All rights reserved. [20:52:03][Step 1/1] <...> [20:53:05][Step 1/1] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [C:\TeamCity\buildAgent3\work\f6172ce9e725797a\<...>\MySubProject.csproj]
[22:38:11][Step 1/1] Process exited with code 1

I've been using this method to build for over 3 months and everything was fine. Build log shows some warnings while building, but other builds with the same warnings passes just fine.

And it's completely random. When build stucks and I manually stop and rerun it - usually it passes. No error messages, no exceptions are shown in build log.

Do you have any ideas what could cause this mystical hang and how to prevent it?

1 comment
Comment actions Permalink

Hi Andrew,

Do you see the same behavior if you start this build from command line?
Please investigate the TeamCity agent machine which is running the build. For more details see the related section in the documentation:
If you think that issue is TeamCity related then please attach several agent thread dumps collected while the build hangs.


Please sign in to leave a comment.