Daniel Godoy
Daniel Godoy

Reputation: 7

How to fetch/copy files from a TFS (Team Foundation Server) with C# (Visual Studio)

I am required to do an escrow of some folders and files located within an TFS. I can move this between my local folders but I still don't have a clue on how to do fetch files from the server. have any of you guys made this before?

Upvotes: 0

Views: 794

Answers (1)

Eugene B.
Eugene B.

Reputation: 302

If this file is under TFS version control (TFVC)There is a TFS REST API to get the file content: https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items#getafile There is also corresponding Git API, if your file is in TFS Git version control:https://www.visualstudio.com/en-us/docs/integrate/api/git/items#streamafile Finally, there is a good article that shows how to call REST API from a C# application: https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client

Upvotes: 1

Related Questions