Thursday, June 23, 2011 7:58 AM
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 C:\tfsproj>
Note: 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 StackOverflow: http://stackoverflow.com/questions/6455942/is-there-workaround-for-when-tfpt-is-unable-to-determine-the-workspace-and-refr
- Edited by davidzarlengo Thursday, June 23, 2011 2:46 PM cross-posted on StackOverflow (link for search engines)
Friday, June 24, 2011 8:55 AMModerator
I tested it in my PC, the "tfpt annotate" can determine the workspace.
D:\TFSWorkspace>%tfcmd% get /all
Warning readme.txt - Unable to perform the get operation because it is writable
---- Summary: 0 conflicts, 1 warnings, 0 errors ----
Warning D:\TFSWorkspace\WpfApplication1\WpfApplication1\readme.txt - Unable to p
erform the get operation because it is writable
Resolved D:\TFSWorkspace\WpfApplication1\WpfApplication1\readme.txt as Overwrite
D:\TFSWorkspace>%tfptcmd% annotate WpfApplication1\WpfApplication1\readme.txt
I also test to create a new workspace in "C:\", still can work. Could you please try to check if you have set the permissions for the workspace? And try to run your command as administrator.
On the other hand, could you please try to check if the "src" sub folder is mapped to the other local folder in the workspace?
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Tuesday, June 28, 2011 11:13 PM
Alright, I think I figured out what is going on. It turns out that 'C:\tfsproj' is a directory symbolic link to 'C:\some\nested\path', and that the TFS workspace is mapped to the nested path. When I run the TFPT command from the second location, it works.
C:\tfsproj> cd C:\some\nested\path C:\some\nested\path> %tfptcmd% annotate src\Readme.txt Computing differences.. Launching viewer
I suspect that there is a bug in TFPT that prevents it from following NTFS directory symbolic links correctly when determining the workspace. After all, the TF commands work from the symbolically-linked directory just fine.
Feel free to report this (I don't know where or I'd do it myself); a bug report would look something like:
Steps to Reproduce:
- Set up a TFS workspace in 'C:\folder1'
- Verify that Visual Studio reports the project '$/' as mapped to 'C:\folder1'
- Create a directory symbolic link to the folder (i.e. 'mklink /d C:\folder2 C:\folder1')
- Switch to the new folder and run 'tf get /preview'
- Observe that the command worked correctly
- Run 'tfpt branches /listBranches:roots
The command should report the branches which are roots, if any.
The command terminates with 'Unable to determine the workspace'.
- Marked As Answer by davidzarlengo Tuesday, June 28, 2011 11:16 PM