Tim Hutchison
Tim Hutchison

Reputation: 3633

Visual Studio Team Services Extension thinks Local Repository is Server Repository

I am using the Visual Studio Team Services extension in VSCode to connect to my TFVS repository. Yesterday, I updated VSCode and the extension now tells me that the repository is a Server repository when it is actually a Local Repository. As far as I can tell, the issue is that I am getting an authentication error which VSCode assumes is because the repository is a server repository. I have tried signing out and back in, changing my password, and changing the repository to a server repository and back to a local repository. Does anyone know how to resolve this error? Additional discussion here

Error Message

enter image description here

Log

2017-11-29T12:56:48.360Z - debug:  [03232] TFVC errors (via stderr): TF30063: You are not authorized to access visualstudio.com\DefaultCollection.

2017-11-29T12:56:48.361Z - error:  [03232] Caught an exception during Tfvc SCM Provider initialization
2017-11-29T12:56:48.361Z - error:  [03232] It appears you are using a Server workspace. Currently, TFVC support is limited to Local workspaces. TF30063: You are not authorized to access visualstudio.com\DefaultCollection.

Upvotes: 3

Views: 2677

Answers (5)

Carlos R Balebona
Carlos R Balebona

Reputation: 1926

For me was working fine and at some point suddenly stopped working. Probably due to an update. How I solved it, in VSCODE:

  1. go to settings
  2. search for: tfvc.location
  3. click on tab "Workspace Settings"
  4. there, just enter the full path to the file: tf.exe (include the file name)

in my case the value is: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe

hope it helps

Upvotes: 0

Olisa Maduka
Olisa Maduka

Reputation: 31

https://github.com/Microsoft/azure-repos-vscode/issues/325#issuecomment-357871328

Try this, worked for me and many others;

  1. Open Developer Command Prompt for VS 2017
  2. Navigate to the workspace root folder
  3. Enter "tf workspace"
  4. Login

Upvotes: 0

Ryan Teh
Ryan Teh

Reputation: 549

For my case, I just ran the following command.
Maybe the work space configurations were cached or something and by running the following commands cleared the cache.
Kudos to you TimHutchison.

CD {wherever your TF.exe is located}
tf workspaces /format:detailed /collection:http://myserver:8080/tfs/DefaultCollection

Upvotes: 0

Vitor de Souza
Vitor de Souza

Reputation: 31

How I fixed it:

  1. 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)
  2. 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)
  3. 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.
  4. Now in VS code, uninstall TFVC, reload it, then install it again.

It made mine work. I think that the step #2 is not really necessary, but since I did it, I won't know... my guess is that this is a bug in the installation.

Upvotes: 3

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51183

At this time, you will need to have a local TFVC workspace already available on your local machine. It's not support with server workspace for TFVC on VScode. So the issue should also not related to the authentication of your account.

Facing this kind of issue, one of the workaround is recreating a local repo on the machine, remember to back up the changes first. And it's better to use tf.exe of VS2017 on your environment.

  • Installed the Visual Studio Team Explorer 2017 ( choose languages pack English during the installation)

  • Configure the new TF.exe in VS Code, my path was "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe"

  • After recreated a local workspace, reopened the VS Code, check if everything works fine.

Moreover, avoid to directly use system file explorer to copy move folders/files in the local TFS repo.

Upvotes: 1

Related Questions