microsoft / azure-repos-vscode

Azure Repos extension for VS Code
Other
661 stars 450 forks source link

TFS Issues - Visual Studio Code #609

Closed PawelMaslak closed 4 years ago

PawelMaslak commented 4 years ago

I have tried to connect TFS to Visual Studio code, followed then all steps needed to set up this and the message I receive is:

"It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces."

Of course I googled for this and found loads of topics similar to that so I tried:

Configure the "tfvc.location" in VS Code, with VS2017 TF.exe file "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe" (recommended to also add to the system path) Open VS2017, and in team explorer home -> solutions panel -> click on the workspace -> Manage workspaces... -> Edit -> Advanced -> Change it to server -> Save and wait it finalize the process -> go back there and now change to local. (If it do not work, recreate the whole workspace) To make sure that everything is Ok, open a command line and type: tf.exe workspaces /format:detailed /collection:xxxx. If it shows that it is a local workspace, it is all good. Now in VS code, uninstall TFVC, reload it, then install it again.

AND

Open Developer Command Prompt for VS 2017 Navigate to the workspace root folder Enter "tf workspace" Login

It does not ask me to login as I can see working folders in this workspace so I assume I am logged in. Unfortunately this is not helping. I also checked for detailed info about Workspace:

Workspace : ABC Owner : ABC Computer : ABC Comment : Collection : abc\DefaultCollection Permissions: Private Location : Local File Time : Current

The message stays the same. I use latest issue of VS Code and VS 2019.

Has anyone found permanent fix to this issue?

atyminski commented 4 years ago

I also have the same issue. I've been trying all of "googled" workarounds - nothing helps. Log:

2020-03-31T10:59:57.932Z - info:   [15380] AzureReposVSCode/1.161.0 (VSCode 1.43.2; Windows_NT 10.0.17763; Node 12.8.1)
2020-03-31T10:59:58.358Z - info:   [15380] Getting repository information with repositoryInfoClient
2020-03-31T11:00:00.302Z - info:   [15380] Getting connectionData with accountClient
2020-03-31T11:00:00.586Z - info:   [15380] Retrieved connectionData with accountClient
2020-03-31T11:00:00.587Z - info:   [15380] Sent extension start up telemetry
2020-03-31T11:00:00.587Z - info:   [15380] Sent TFVC tooling telemetry
2020-03-31T11:00:01.740Z - error:  [15380] Caught an exception during Tfvc SCM Provider initialization
2020-03-31T11:00:01.741Z - error:  [15380] It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces.
PawelMaslak commented 4 years ago

I also have the same issue. I've been trying all of "googled" workarounds - nothing helps.

The way around this issue is to open your project in Visual Studio and commit from there. The disadvantage of this is very unfortunate as Visual Studio does not detect changes in the code so I have to delete project from source control and then add it once again. Still, I find it better than losing your code so I do that. It's so surprising that VS Code works so fine with GIT whereas with TFS is total shambles.

atyminski commented 4 years ago

I solved it in my case. The problem was in login credentials... when i typed login with domain (domain\username) it has started working. I had to debug the exetension to discover it 😅

Take a look: https://github.com/microsoft/azure-repos-vscode/blob/513950d99ef5201db1824cb23914523069105c76/src/tfvc/commands/commandhelper.ts#L77-L82

In my case the problem was with command:

tf resolve -noprompt -login:{configured_login},{configured_password} {dir} -recursive -preview