Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS command line 'Get' failing

I usually use the VS GUI for TFS and have never had any problem.

I am trying to get the command line working and am running TF from the root of the collection's mapped directory.

When I run TF Get <project name> /noprompt / recursive

I get the error message:

Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.

I have run this but the error still exists.

When I run TF workspaces I have an entry for the computer I am on (the TFS source is on a different PC) and the collection path http://<comp name:port>/TFS/<project> which is correct.

Has anyone else been in this situation? The various pages I have found talking about it seem to stop after running the tf workspaces command. Has this always worked for everyone else? Perhaps I am just using it wrong?

like image 858
Stefan Avatar asked Oct 23 '13 14:10

Stefan


People also ask

What is TF command?

Flows text to a blank line or to the end of the text. Category: Text Editing, Line Command.

Which window is used to execute commands directly by writing into the window?

The Command window is used to execute commands or aliases directly in the Visual Studio integrated development environment (IDE). You can execute both menu commands and commands that do not appear on any menu. To display the Command window, choose Other Windows from the View menu, and select Command Window.

Where is TF EXE in Visual Studio 2017?

On the 2017 version of Visual Studio Community, it can be found in a location similar to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe .


2 Answers

You are getting this message because the TF get is being run outside of your workspace directory CD to the directory that contains the workspace that you need to work with first.

like image 98
Mike Beeler Avatar answered Oct 07 '22 01:10

Mike Beeler


The commandline isn't asking for the TFS server uri, but for the ProjectCollection uri, so you need to add some extra information:

{https}://{tfsserver}:{port}/tfs/{collection}

Replace:

{https} make sure you use the right protocol, http or https.

{tfsserver} with the hostname of your tfs server

{port} with the port number (default: 8080 or 443)

{collection} with the project collection name (installation default: DefaultCollection)

The ProjectCollection isn't the same thing as the project, so make sure you're entering the correct values. Easiest place to find the collection name is to open Visual Studio and then the Source Control Explorer. The Uri for the project collection should be the root node. It might be that you're entering the Project name, instead of the ProjectCollection name.

If you're in a folder mapped to TFS, then tf get should figure the CollectionUri by itself.

When you have Visual Studio 2010 and 2012 or 2013 installed side-by-side, make sure you're using the Developer Command Prompt from the correct version of Visual Studio. With the advent of Local Workspaces, the 2010 commandline may not be able to find your mappings, where the 2012 or 2013 commandline will.

like image 38
jessehouwing Avatar answered Oct 06 '22 23:10

jessehouwing