【问题标题】:Timeout when fetching ItemContent from Azure DevOps从 Azure DevOps 获取 ItemContent 时超时
【发布时间】:2020-10-07 04:23:42
【问题描述】:

我正在使用 Azure DevOps SDK for (Microsoft.VisualStudio.Services.Client) 从 Azure DevOps 获取更改集和这些更改集的内容。

我可以创建一个VssConnectionTfvcHttpClient,并且前两个文件的内容提取工作正常。但是当我尝试下载第三个文件的内容时,会出现超时。

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
}

我做错了什么?

【问题讨论】:

    标签: c# azure-devops tfvc


    【解决方案1】:

    我发现最简单的解决方法是为每次下载创建一个新的VssConnection 和一个新的TfvcHttpClient。这感觉效率低下,但它停止了超时。

    【讨论】:

    • 太棒了!感谢您在此处分享您的解决方案,您可以接受它作为答案,这样它可以帮助遇到相同问题的其他社区成员,我们可以存档此线程,谢谢。
    猜你喜欢
    • 1970-01-01
    • 2020-12-09
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多