I am building an app, which should have a functionality to copy files from a local folder and save it in TFS on a button click. I did lot of googling to get a solution for this purpose , I couldn't find an apt one. So, my question is, is it possible to add new files to TFS programatically using C#?. If yes, then is there any restriction on the file types we can add to TFS?. if we can add new files from a local folder to TFS programmatically, can someone please provide me a reference code for the same?. Thanks in advance
What I have tried:
I have tried creating a workspace and add file to the workspace using PendAdd method. The workspace is getting created, but I couldn't find the workspace in the TFS. Below is the code I have used to create the workspace
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(<tfs uri>));
tfs.EnsureAuthenticated();
VersionControlServer vcs = tfs.GetService<versioncontrolserver>();
Workspace ws = vcs.CreateWorkspace("DCSCode");
//"I:temp" is the location of files which needs to be
//moved to TFS
int r = ws.PendAdd(@"I:temp");