Reputation: 13
We are trying to integrate Visual Studio Code with Microsoft Visual Studio Team Foundation Server. Our Visual Studio Code version is 1.87.0
We installed TFS extension as suggested here
Then we setup the TF path
Then we tried Alt+T -> Add files and folders to version control. At that time we faced following issue
We tried tf workspace and gor error as below Screen shot from VSCode
We added env variable also Screen shot Env variable
how do we need to fix this?
Upvotes: 0
Views: 467
Reputation: 6037
Since you have installed VS, you may consider to Develop and share code in TFVC with Visual Studio instead of VSCode.
As for the error thattf command is not recognized
in normal PowerShell prompt, we can add the path to tf.exe
into the Path
environment variable.
We can then open a new PowerShell session or reopen VSCode -> Test to run tf workspaces
command in the terminal session and see if tf
command can work.
Before using the TFS
VSCode extension, you need to create a local workspace mapping with the remote TFVC repo in Azure DevOps Server.
For this, you can run tf workspace /new
commands in Developer PowerShell of Visual Studio. See Workspace command (Team Foundation Version Control) for more details.
tf workspace /new TFVCProject-LocalWorkspace /comment:"Local workspace for TFVCProject" /collection:http://aztfs2022/DefaultCollection/
Then you may open your local workspace folder in VSCode -> Press Alt+T
-> Select a file to Check Out for Edit
;
What worth mentioning is that this extension doesn't seem to enable check-in
function in the shortcut menu. See this open issue no check-in · Issue #7 · generalov/vscode-tfs · GitHub. You may reach out to the extension author/maintainer for confirmation.
The workaround is to run tf checkin
command. I expose the path of tf.exe
into environment variables PATH
to run tf
commands directly in VSCode Terminal
session
Please be advised to BACKUP your current pending changes before testing the workflow.
Upvotes: 0