none
Tfs workspace mapping to wrong folder

    Question

  • 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? 

    Wednesday, July 03, 2013 1:25 PM

Answers

  • Yes . i tried with "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE” but got same error.

    Then i tried something like below.It worked without mapping to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE". But i don't know whether doing this will give any error in future as i map to this folder once in command.Below is new command

     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 "$\" "\\pc100\desktop\new" /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"
    How this works i don't know .But i guess the command(3rd line) overwrites the workspace mapped to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" as it is mapped to "$\". Is it correct? Doing this one will cause any error?


    Also i posted bug here
    Friday, July 05, 2013 11:19 AM
  • Hi Researcher, 

    Thanks for your reply.

    Yes, you can use this workaround to change the mapping relationship between TFS Source Control folder and Local folder. Your workaround(command lines) like we edit the working folders in Edit Workspace dialog manually.

    Thank you for share your experience here.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 05, 2013 11:47 AM

All replies

  • Hi Researcher, 

    Thanks for your post.

    You’re using TFS 2012, but you only have the VS 2008 as client connect to TFS 2012?

    First, if you have VS 2012 installed on your client, you should execute the tf workspace command in VS 2012 Command Prompt or run command under this location “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE”. Like the blew:

       cd  “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE”

       tf workspace /noprompt  /new   mynewworkspace;”username”  /collection:”http://pc1:8080/tfs/newcollection”

       tf workfold  /map  “$/newproject/Quick setup”  “\\pc100\desktop\new”  /collection:”http://pc1:8080/tfs/newcollection” /workspace:mynewworkspace

       tf get “\\pc100\desktop\new”  /recursive

    I test these command lines and received the same issue, in Manage Workspace>>Edit Workspace mynewworkspace dialog, I found that: not only the “$/xx/xx” mapped to local folder \\xxx\xxx, but also the “$/” show mapped to “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE” in Edit Workspace mynewworkspace dialog. For this scenario, please submit it to Microsoft Connect Feedback portal at: https://connect.microsoft.com/VisualStudio. Microsoft engineers will evaluate them seriously.  

    To resolve “The path C:\xxx\xxx\IDE is already mapped in workspace mynewworkspace” issue, please Remove this mynewworkspace from VS 2012>>Manage Workspace dialog. After Remove nynewworkspace from VS, I can execute the tf workspace /new myneworkspace command to recreate this mynewworkspace, but will receive the first issue again: “$/” mapped to “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE”.  


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 05, 2013 10:00 AM
  • Yes . i tried with "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE” but got same error.

    Then i tried something like below.It worked without mapping to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE". But i don't know whether doing this will give any error in future as i map to this folder once in command.Below is new command

     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 "$\" "\\pc100\desktop\new" /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"
    How this works i don't know .But i guess the command(3rd line) overwrites the workspace mapped to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" as it is mapped to "$\". Is it correct? Doing this one will cause any error?


    Also i posted bug here
    Friday, July 05, 2013 11:19 AM
  • Hi Researcher, 

    Thanks for your reply.

    Yes, you can use this workaround to change the mapping relationship between TFS Source Control folder and Local folder. Your workaround(command lines) like we edit the working folders in Edit Workspace dialog manually.

    Thank you for share your experience here.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 05, 2013 11:47 AM