Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tfs workspace mapping to wrong folder

I am using TFS 2012.I used command line to create workspace and map it to a folder.But i got some error after creating workspace by using this.Error is that

cd "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
tf workspace /noprompt /new mynewworkspace;"myusername" /server:"http://pc1:8080/tfs/newcollection"
tf workfold /map "$\newproject/Quick setup" "\\pc100\desktop\new" /server:"http://pc1:8080/tfs/newcollection" /workspace:mynewworkspace
tf get /recursive "\\pc100\desktop\new"

After running these workspace "mynewworkspace" created but folders mapped are not proper.

When i checked details of mapping in team explorer the workspace had two mapping instead of one.

First one was "$/"(source control folder) mapped to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"(local folder)

and

"$\newproject/Quick setup" (source control folder) mapped to "\pc100\desktop\new"

I dont know why the first mapping occured(that is "$/"(source control folder) mapped to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"(local folder)) which was not there in my commands.

So please help me on this. what is wrong in my commands?

So after this i deleted workspace from the tfs so that mapping to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" will delete. but now if run command to create new workspace

cd "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
tf workspace /noprompt /new mynewworkspace;"myusername" /server:"http://pc1:8080/tfs/newcollection"

then error comes like "The path C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE is already mapped in workspace mynewworkspace"

But actually i have deleted the workspace before itself. So what should i do now to solve both two problems?

like image 695
IT researcher Avatar asked Feb 05 '26 09:02

IT researcher


1 Answers

When you create a new workspace (using the tf workspace command) it maps it to the current working directory.

If you get rid of the /noprompt you will be prompted and able to change this.

See the relevant documentation here: http://msdn.microsoft.com/en-us/library/y901w7se(v=vs.100).aspx

To make the current directory a working folder for an existing workspace on your computer, type tf workspace workspacename, where workspacename is the name of the existing workspace. The Edit Workspace dialog box appears. Click click here to enter a new working folder, type the server path for which you want to map the current directory in the Source Control Folder box, type the current directory in the Local Folder box, and click OK.

like image 163
Dylan Smith Avatar answered Feb 07 '26 16:02

Dylan Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!