Is there workaround for when TFPT is “unable to determine the workspace” and refreshing the cache does not work?

后端 未结 6 1951
长发绾君心
长发绾君心 2021-02-12 09:49

I\'m having trouble getting TFPT.exe to work at all, even after trying to refresh the cached workspace settings per the usual advice on the internet. See below for a log repres

相关标签:
6条回答
  • 2021-02-12 09:56

    As long as you are inside the working directory, tfpt annotate should work. If you are getting the message "Unable to determine the workspace" then it is a caching issue.

    If, as you said, you ran tf workspaces /s:serverURL and it still doesn't resolve I would try creating a new workspace and testing it out there. If that works then something wrong with the workspace obviously and I would just delete it and use the new one. If both fail then of course there is a bigger problem but that is how I would approach it.

    0 讨论(0)
  • 2021-02-12 09:58

    I had this same error and the problem was that when I ran tfpt from the command line it was resolving to the 2008 version of the power tools instead of the 2010 version.

    Run tfpt with no arguments and in the help it dumps out, it tells you which version it is.

    0 讨论(0)
  • 2021-02-12 10:10

    For those in vs2017: try firing up vs2015 (not 2017), make sure to connect to TFS server in vs2015, and then tfpt worked just fine.

    But note: it sounds like the tf powertools commands are being integrated into the new tfs tooling, so tfpt is not really a thing in 2017. See Daniel Mann's answer here for more info and helpful links: tfpt.exe on Visual Studio 2017

    0 讨论(0)
  • 2021-02-12 10:12

    In my case, here is how I arrived to this problem (error message "Unable to determine the workspace"), and how I solved it.

    Arrival:

    I had some code. The development moved from the branch in which I worked (lets call it Branch1) to Branch2. I had to continue under Branch2. I shelved the changes, re-mapped my development folder to Branch2, opened Developer Command Prompt for VS2012 and ran the following command

    tfpt unshelve /migrate /source:"$/path/Branch1" /target:"$/path/Branch2" "Shelveset Name"

    Here I've got the "Unable..." message

    Solution:

    In my case, the problem was that when I opened command prompt, its working directory was c:\program files\...\...Visual Studio 11.... It worked (migrating shelveset) when I changed working directory to the directory of the Branch itself: c:\MyBranchFolder

    0 讨论(0)
  • 2021-02-12 10:20

    This suggestion from a similar discussion on MSDN forums helped me:

    You need to make sure that you are running the commands from a mapped folder, you can run tf workfold to see if the current folder is mapped or not (i.e in your case run the commands from C:\Temp)

    0 讨论(0)
  • 2021-02-12 10:21

    After taking a fresh look at this, it turns out that 'C:\tfsproj' is a directory symbolic link to 'C:\some\nested\path'. Running the TFPT command from the nested path works as expected.

    Interestingly, the TFS workspace was mapped to the nested path, so it is surprising that TF commands (e.g. tf get /preview) were able work correctly from the alias path.

    I suspect that TFPT does not follow NTFS directory symbolic links correctly when determining the workspace.

    0 讨论(0)
提交回复
热议问题