Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Could not find a workspace with mappings #174

Closed
knegg opened this issue Apr 13, 2017 · 5 comments
Closed

Could not find a workspace with mappings #174

knegg opened this issue Apr 13, 2017 · 5 comments

Comments

@knegg
Copy link

knegg commented Apr 13, 2017

Hi there,

thanks for an awesome update - this will be great once i get it to work :-)

I have now been struggling for several hours, but have not found a solution yet. I´m a noob at this, so there is always a possibility that i have done something wrong.

I have read the tutorial, and watched the instruction video (Linux) - but i still get the error-message. Can you take a look at the log-file further down, and see if there is something obvious that i am doing wrong here?

Settings in VS Code:
"tfvc.location": "/Users/oyvindbergesen/Dropbox/Repos/tfs-command/tf",
"tfvc.proxy": "https://yetzweb.visualstudio.com:8080/MyFirstProject",

Some more info:

  • Mac OSX Sierra 10.12.4
  • Visual Studio Code - Version 1.11.1
  • Visual Studio Team Services Extension - Version 1.116.0
  • java version "1.8.0_121"

Logfile from VS Code:
`2017-04-13T16:14:32.659Z - info: [0976] *** FOLDER: /Users/oyvindbergesen/Downloads/MyFirstProject ***
2017-04-13T16:14:32.661Z - debug: [0976] Looking for an External Context at /Users/oyvindbergesen/Downloads/MyFirstProject
2017-04-13T16:14:32.661Z - debug: [0976] No External Context at /Users/oyvindbergesen/Downloads/MyFirstProject
2017-04-13T16:14:32.664Z - debug: [0976] Looking for TFVC repository at /Users/oyvindbergesen/Downloads/MyFirstProject
2017-04-13T16:14:32.665Z - debug: [0976] TFVC Creating Tfvc object with localPath='undefined'
2017-04-13T16:14:32.665Z - debug: [0976] Using TFS proxy: https://yetzweb.visualstudio.com:8080/MyFirstProject
2017-04-13T16:14:32.665Z - debug: [0976] TFVC Retrieved from settings; localPath='/Users/oyvindbergesen/Dropbox/Repos/tfs-command/tf'
2017-04-13T16:14:32.667Z - debug: [0976] TFVC Repository created with repositoryRootFolder='/Users/oyvindbergesen/Downloads/MyFirstProject'
2017-04-13T16:14:32.667Z - debug: [0976] TFVC Repository.CheckVersion
2017-04-13T16:14:32.669Z - debug: [0976] TFVC: tf add -noprompt -? -proxy:https://yetzweb.visualstudio.com:8080/MyFirstProject
2017-04-13T16:14:32.675Z - debug: [0976] TFVC: spawned new process (duration: 4ms)
2017-04-13T16:14:32.687Z - debug: [0976] TFVC: spawned new process (duration: 12ms)
2017-04-13T16:14:34.550Z - debug: [0976] TFVC: add exit code: 0 (duration: 1881ms)
2017-04-13T16:14:34.553Z - debug: [0976] TFVC Repository.FindWorkspace with localPath='/Users/oyvindbergesen/Downloads/MyFirstProject'
2017-04-13T16:14:34.554Z - debug: [0976] TFVC: tf workfold -noprompt ******** -proxy:https://yetzweb.visualstudio.com:8080/MyFirstProject
2017-04-13T16:14:34.558Z - debug: [0976] TFVC: spawned new process (duration: 3ms)
2017-04-13T16:14:34.738Z - debug: [0976] TFVC: workfold exit code: 100 (duration: 184ms)
2017-04-13T16:14:34.740Z - debug: [0976] TFVC errors: An argument error occurred: The workspace could not be determined from any argument paths or the current working directory.

2017-04-13T16:14:34.741Z - error: [0976] Could not find a workspace with mappings. Perhaps the wrong version of TF is being used with the selected folder?`

Regards
Øyvind

@jeffyoung
Copy link
Contributor

Hi Øyvind, thanks for trying out the extension!

Based on the error message from the workfold command, there's no workspace existing at the folder "/Users/oyvindbergesen/Downloads/MyFirstProject". Have you created a TFVC local workspace at the location?

Also, I'm a little bit confused by the value you set for tfvc.proxy. Since I don't have any details about the TFS server you're connecting to, I'd start by removing that setting. If you do end up needing to set up the proxy, we can always re-add it.

But, for my information, are you attempting to connect to a TFVC repository on Visual Studio Team Services (e.g., account.visualstudio.com) or a local on-premises server (e.g, http://my-tfvc-server:8080/tfs)?

@knegg
Copy link
Author

knegg commented Apr 13, 2017

Hi again,

That was a quick reply :-)

I am indeed trying to connect to TFVC repository on Visual Studio Team Services.

I created the project at yetzweb.visualstudio.com. Then i downloaded the "MyFirstProject" as a zip from the webpage. Unzipped it in my download-folder on my mac (this is just for testing-purposes. Once this works, i will do the proper setup).

I then open the folder with Visual Studio Code (MyFirstProject).

Next i open up terminal, and add the command:
/Users/oyvindbergesen/Dropbox/Repos/tfs-command/tf workspaces -collection:https://yetzweb.visualstudio.com:8080/MyFirstProject
I am then prompted for credentials in a pop-up window. (screenshot: https://www.dropbox.com/s/ntivellqcdqzfzk/Skjermbilde%202017-04-13%2020.09.17.png?dl=0)

After login, the pop-up disappears. There is no more info in the terminal window if the login is successful or not. As i expect that the login is successful, i then head over to Visual Studio Code again - running CMD + P and attempt the "Team signin".

This is when i get the error-message:

(team) No Team Services or Team Foundation Server repository configuration was found. Ensure you've opened a folder that contains a repository.

Sorry - i am really a noob at this, but how do i create a TFVC local workspace? (i have just downloaded the .zip-file of the project as mentioned above.

Thanks for any help :-)

Regards
Øyvind

@jeffyoung
Copy link
Contributor

Then i downloaded the "MyFirstProject" as a zip from the webpage.
Downloading the source is really only useful if you want to search it more efficiently than through the web browser. With TFVC, you need to make TFVC aware of the workspace on your machine. So you'll need to enlist in that source code either through an IDE initially or via the TF command line. You can't just grab the code and then 'initialize' (for lack of a better word) the workspace based on what you have locally.

Since you're working on a Mac with Team Foundation Version Control, I'm wondering if you're using one of the JetBrains IDEs (like Android Studio or IntelliJ)? Or are you really just starting out with TFVC (and is that what you mean by "i am really a noob at this")? 😄

If you haven't used TFVC before, you might want to check out our documentation starting with https://www.visualstudio.com/en-us/docs/tfvc/overview. Admittedly, there's a TON of information there.

For now, I'll assume that you've got a TFVC repository up on Team Services that you need to contribute to and you don't have any other IDE to use in order to create your local workspace (also known as 'the hard way to create a TFVC workspace' 😄).

Before you begin (and so you don't get prompted on each command you run), you'll want to set TF_AUTO_SAVE_CREDENTIALS=1 (case-sensitive). Likely do this in your profile so you don't lose the setting.

Then, go ahead and run:

tf workspaces -collection:https://yetzweb.visualstudio.com

That should prompt for credentials and then return some information (probably with a message about there not being any workspaces found).

Next, you need to create a local workspace on your machine. Change 'myWorkspaceName' to a value of your choosing.

tf workspace -new -collection:https://yetzweb.visualstudio.com -location:local myWorkspaceName

When successful, this command will return a message similar to 'Workspace 'myWorkspaceName' created.'.

Now that you have a workspace, you need to map folders into it (making that workspace aware of what source files you have 'enlisted'). I'm going to assume that your TFVC repository is named 'MyFirstProject'. At this point, you want to be running in a directory where you want your source code to go. Now map your folders with this command:

tf workfold -map -collection:https://yetzweb.visualstudio.com -workspace:myWorkspaceName $/MyFirstProject .

When successful, this command won't return any information.

Finally, you need to get the source code from the remote server:

tf get

This will pull down all of the code in that project. At this point, you should be able to open that folder (that contains your source) in Visual Studio Code. When you do, you'll likely be prompted by the extension for credentials. Since you're using VSTS, you'll need to create a PAT; see this video. Once you provide the PAT to the extension, everything will initialize and the TFVC Viewlet should be ready to use.

Give all of that a shot and let's see how far we get. 😄

@knegg
Copy link
Author

knegg commented Apr 13, 2017

Hi again,

thanks for a lot of useful information :-)

I am a noob using TFVC (first time) - used GitHub prior to this - and thats plug&play. But for our next project we are using TFVC. So needed to get this to work.

And... thanks to you - it now works! I used a combination of your description, Eclipse and the Team Explorer extention. By using Eclipse and Team Explorer i created the local workspace - using this tutorial: http://java.visualstudio.com/Docs/tools/eclipse

Turns out that the settings in Visual Studio Code needed to be commented out as you mentioned in your first reply. It actually prevented Visual Studio Code to connect to TFVC as long as it was present in the settings:

tfvc.proxy": "https://projectname.visualstudio.com:8080

At the exact moment of commenting out the line in settings, i was prompted with the "message" that is part of your youtube tutorial: https://www.youtube.com/watch?v=t6gGfj8WOgg&feature=youtu.be

So just followed the steps in the youtube-tutorial, and now it works as it should. Now i will just have to replicate the process for the actual project. But now i know how to do it... hopefully! ;-)

Thank you so much for all the help - you saved me hours of frustration :-)

Regards
Øyvind

@jeffyoung
Copy link
Contributor

Fantastic! I'm glad you got it all figured out Øyvind. Good luck and if you've ever got any feedback, let us know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants