Search code examples
c#azure-devopstfvc

Timeout when fetching ItemContent from Azure DevOps


I am using the Azure DevOps SDK for (Microsoft.VisualStudio.Services.Client) for fetching change sets and the contents of those change sets from Azure DevOps.

I can create a VssConnectionand TfvcHttpClient and the fetching of the content works ok for the first two files. But when I try and download content for a third file, there is a timeout.

string url = '<url to devops site>';
string path = '<path to item in devops>';
var connection = new VssConnection(new Uri(url), new VssClientCredentials());
TfvcHttpClient client = connection.GetClient<TfvcHttpClient>();
using(var contentStream = await client.GetItemContentAsync(path))
{
  //Do stuff with content stream
}

What am I doing wrong?


Solution

  • I found the easiest fix was to create a new VssConnection and a new TfvcHttpClient for every download. This feels inefficient but it stopped the timeout.