Search code examples
tfsworkspace

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


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 representative of what I've tried and am seeing. Can anyone explain why "tf get" is able to detemine the workspace, but "tfpt annotate" fails?

C:\tfsproj> set tfptcmd="C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\TFPT.exe"
C:\tfsproj> set tfcmd="C:\Program Files (x86)\Microsoft Visual Studio   10.0\Common7\IDE\TF.exe"
C:\tfsproj> %tfcmd% workspaces /s:http://tfs:8080/tfs/Apps
Collection: tfs\Apps
Workspace Owner          Computer Comment
--------- -------------- -------- ---------------------------------------------
DAVID     David_Zarlengo DAVID

C:\tfsproj> %tfcmd% get /preview
C:\tfsproj\src\:
Replacing Readme.txt

C:\tfsproj> %tfptcmd% annotate src\Readme.txt
Unable to determine the workspace

When I edit the workspace in Visual Studio 2010, the "Working folders" grid contains 3 rows, one of which is "Active, $/Foo, C:\tfsproj", therefore, I assume the folder is mapped correctly.

cross-posted on Team Foundation Server – Power Tools & Add-ons


Solution

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