问题
I am trying to automate to get the latest code from TFS server to local path. The initial step for this is to create a workspace in TFS server if not exist already. How will i create the workspace with local folders mapping to the server folders.
回答1:
Use the VersionControlServer.CreateWorkSpace method to create a workspace and set the working folders (use one of the overloads that accepts a WorkingFolder[]. Or update the workspace after initial creation. You can add addtional mappings and cloaks to the workspace at any point in time.
Getting to the VersionControlServer
and connecting to TFS using the API is described in this post.
来源:https://stackoverflow.com/questions/21682662/how-do-i-create-a-workspace-with-local-folder-mappings-in-tfs-using-c-sharp