简体   繁体   English

使用MVC应用程序C#中的API将文件/文件夹添加到Visual Studio Team Services(曾是TFS在线)

[英]Add files/folder to Visual Studio Team Services (was TFS Online) using API from MVC application C#

I am trying to upload a file to Visual Studio Team Services using RestAPI from an MVC C# based application. 我试图从基于MVC C#的应用程序中使用RestAPI将文件上传到Visual Studio Team Services。 But not able to get the how to upload or add a file or create a folder using api. 但是无法获取如何使用api上传或添加文件或创建文件夹的方法。

Can anyone please let me know what api method do I need to call to perform this action. 谁能让我知道执行此操作需要调用哪些api方法。

As per my understanding the files that we add in Team Services, via api we can call from Version Control Items ( https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items ), from this api I understand that we can get the item and its metadata. 据我了解,我们通过api从Team Control中添加的文件可以从Version Control Items( https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items )中调用api我知道我们可以获取该项目及其元数据。 But how to upload an file/folder? 但是如何上传文件/文件夹?

Thanks in Advance! 提前致谢!

If you are using Git as source control, you can use this API to add, edit, rename, move, and delete files in a Git repository. 如果将Git用作源代码管理,则可以使用此API在Git存储库中添加,编辑,重命名,移动和删除文件。 You can either make changes in an existing branch or create a new one. 您可以在现有分支中进行更改,也可以创建一个新分支。

If you are using TFVC as source control, there is no related REST API can achieve for now. 如果您将TFVC用作源代码控制,则目前尚无相关的REST API。 However you can use Team Foundation version control commands as a workaround, Checkin command should do the trick. 但是,您可以使用Team Foundation版本控制命令作为解决方法, Checkin命令应该可以解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 扩展Visual Studio Team Services(在TFS上在线) - Extend Visual Studio Team Services (was TFS Online) 从VS2010中的WinForms代码对Visual Studio Team Services(是TFS在线)的身份验证失败 - Authentication to Visual Studio Team Services (was TFS Online) fails from WinForms code in VS2010 如何使用C#从TFS(Team Foundation Server)中获取/复制文件(Visual Studio) - How to fetch/copy files from a TFS (Team Foundation Server) with C# (Visual Studio) 使用API​​为Visual Studio Team Services添加附件(是Visual Studio Online) - Adding Attachment using API for Visual Studio Team Services (was Visual Studio Online) “ Visual Studio Online无法提供Team Foundation服务” - “Team Foundation services are not available from” Visual Studio Online 如何在不依赖Visual Studio版本的情况下使用C#从TFS检出文件? - How to Checkout Files From TFS using C# Without Being dependent on Visual Studio Version? 通过TFS API REST或TFS SERVER API C#在TFS 2017中添加团队管理员 - Add team's administrator in TFS 2017 by TFS API REST or TFS SERVER API C# 通过TFS API从Visual Studio Online获取构建定义 - Fetching build definitions from Visual Studio Online through TFS API MVC 5构建在Visual Studio Team Services上失败 - MVC 5 build failing on Visual Studio Team Services 使用EnvDTE API从Visual Studio加载项内部以编程方式将文件添加为C#项目中的链接 - Programmaticaly add file as a link in C# project from inside visual studio add-in using EnvDTE API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM