Timeouts uploading bits to drop folder from on-prem build controller connected to VSO

Had an interesting case recently. Customer was using an on-prem build controller connected to VSO. His Team Project was backed by Git and he had a team build using the GitTemplate.12.xaml Build Template. Problem was the build definition was failing about 78% of the time. The build itself completed, but the final phase failed.  The error was:

Exception Message: The HTTP request timed out after 00:01:40. (type TimeoutException)
Exception Stack Trace:    at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
   at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Inner Exception Details:
Exception Message: A task was canceled. (type TaskCanceledException)
Exception Stack Trace:    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.<SendAsync>d__0.MoveNext()


- We tested building a simple Hello World VS project and that built 100% (no errors).
- The failing build had the “Copy build output to the server” option selected on the “Build defaults” tab. We changed this to both “Copy build output to the following drop folder“ and “This build does not copy output files to a drop folder” and the build succeeded in each case.


Finally came to find a fix. In tfsbuildservicehost.exe.config* add the appSettings key of ServerDrop.MaxRequestTimeInSeconds with an int value for seconds. As an example add this... 

        <add key="ServerDrop.MaxRequestTimeInSeconds" value="300"/>


...and now the timeout is 5 minutes.



*C:\Program Files\Microsoft Team Foundation Server 12.0\Tools is where you’ll usually find tfsbuildservicehost.exe.config. You may need to turn on “FILE NAME EXTENSIONS” in File Explorer. 

Comments (5)
  1. Adam Plocher says:

    Thanks, this was very helpful. This was driving me crazy, I ended up changing it to a UNC drop and giving it a local UNC path: \localhostC$BuildOut (so it's C:BuildOut on the build server).

    In this case you would need to make sure the build controller is running as an admin – I think Local System would have access.   I have my build controller running under my domain account, which might not be recommended since I'm a domain admin, but I just wanted to see if there was anything permission related that was causing this to fail.  

    Probably the safer bet is to share out an individual folder and only grant access to it from the service.  

    If it was timing out after 180 seconds before, then that seems like 3+ extra minutes that would be added to my build, and that's not cool. This solution seems to eliminate the timeout.

  2. gkarkalis says:

    Great thanks, I also had the exact same problem!

  3. Joshka says:


    I'm seeing this issue on the VSO Hosted build controller. Same exception message and setup (fairly close to the the default Azure website CI build configuration). Is there a way to modify this setting on VSO, or a configuration option. Happy to provide logs etc. My email address is my name @ my name dot net.

  4. gblmarquez says:

    Thanks!!!! The same problem here using TFS Online!


  5. Asser Fahrenholz says:

    Where in the file do I add this ? I gives an error when I try in the <configuration> part.

    Kind regards,

    Asser Fahrenholz

Comments are closed.

Skip to main content