本文介绍了如何以编程方式从VSTS下载解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我需要一种从Visual Studio Team Services下载源代码的方法,基本上我需要压缩解压缩,就像我在VSTS网站上手动下载一样。 我尝试过: 我一直通过VSTS API参考:Projects | Visual Studio Team Services和Team Foundation Server的REST API参考 [ ^ ]但不幸的是我找不到我需要的东西。 解决方法: 1.发出POST并检索 items batch 将返回主分支中所有文件的列表 谢谢。 2.遍历列表并下载文件 但我真的以为会有一个选项来下载文件夹或分支中的文件压缩。I need a way to download a source code from Visual Studio Team Services, basically I need a solution zipped, just as you can download it manually when I am on VSTS site.What I have tried:I've been through VSTS API reference: Projects | REST API Reference for Visual Studio Team Services and Team Foundation Server[^] but unfortunately I am failing to find what I need.Workaround:1. Issue a POST and retrieve items batch that will return a list of all files from Main branchThanks.2. Iterate through list and download files one by onebut I'd really thought there will be an option to download a zip of files in folder or in a branch.推荐答案Microsoft.TeamFoundation.SourceControl.WebApi.TfvcHttpClient.GetItemsBatchZipAsync(TfvcItemRequestData itemRequestData, Guid project) 这是一个完整的代码示例:Here is a complete code example:using System;using System.IO;using Microsoft.TeamFoundation.Core.WebApi;using Microsoft.TeamFoundation.SourceControl.WebApi;using Microsoft.VisualStudio.Services.Common;namespace BuildAndDeploy.GetSourceTest{ class Program { static void Main(string[] args) { var path = " 这篇关于如何以编程方式从VSTS下载解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-26 09:14