当 TFPT “无法确定工作空间”时,是否有解决方法?并且刷新缓存不起作用?
即使在尝试按照互联网上的常规建议刷新缓存的工作区设置后,我也无法让 TFPT.exe 正常工作。请参阅下面的日志,了解我所尝试和所看到的内容。谁能解释为什么“tf get”能够确定工作空间,但“tfpt annotate”失败?
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
当我在 Visual Studio 2010 中编辑工作区时,“工作文件夹”网格包含 3 行,其中一行是“Active, $/Foo, C:\tfsproj”,因此,我假设该文件夹已正确映射。
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
此建议来自 MSDN 论坛上的类似讨论 帮助了我:
This suggestion from a similar discussion on MSDN forums helped me:
对于 vs2017 中的用户:尝试启动 vs2015(不是 2017),确保连接到 vs2015 中的 TFS 服务器,然后 tfpt 就可以正常工作了。
但请注意:听起来 tf powertools 命令正在集成到新的 tfs 工具中,因此 tfpt 在 2017 年并不是真正的东西。有关更多信息和有用的链接,请参阅 Daniel Mann 的答案:Visual Studio 上的 tfpt.exe 2017
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
我遇到了同样的错误,问题是当我从命令行运行 tfpt 时,它解析为 2008 版本的电动工具而不是 2010 版本。
不带任何参数运行 tfpt,在它转储的帮助中,它会告诉您它是哪个版本。
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.
重新审视这一点后,发现“C:\tfsproj”是“C:\some\nested\path”的目录符号链接。从嵌套路径运行 TFPT 命令可以按预期工作。
有趣的是,TFS 工作区映射到嵌套路径,因此令人惊讶的是 TF 命令(例如 tf get /preview)能够从别名路径正常工作。
我怀疑 TFPT 在确定工作空间时没有正确遵循 NTFS 目录符号链接。
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.
只要您位于工作目录中,tfpt annotate 就应该可以工作。如果您收到消息“无法确定工作区”,那么这是一个缓存问题。
如果,正如您所说,您运行了 tfworkspaces/s:serverURL 但它仍然无法解决,我会尝试创建一个新的工作区并在那里进行测试。如果这有效,那么工作区显然有问题,我只需删除它并使用新的。如果两者都失败了,那么当然会有一个更大的问题,但这就是我的处理方法。
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.
就我而言,以下是我遇到此问题的方法(错误消息“无法确定工作空间”)以及解决方法。
到达:
我有一些代码。开发工作从我工作的分支(我们称之为Branch1)转移到了Branch2。我必须在Branch2下继续。我搁置了更改,将我的开发文件夹重新映射到 Branch2,打开 VS2012 的开发人员命令提示符 并运行以下命令
这里我收到“无法...”消息
解决方案:
就我而言,问题是当我打开命令提示符时,其工作目录为
c:\program files\...\...Visual Studio 11...
。当我将工作目录更改为分支本身的目录时,它起作用了(迁移搁置集):c:\MyBranchFolder
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
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