TFPT.exe 如何找到要在哪个工作区中工作?
在从命令中使用 tfpt 时,我收到错误:
PS D:\Main Line> tfpt uu /noget
Unable to determine the workspace.
这里我尝试使用“撤消未更改”命令,但我在其他命令中也看到了此错误。我所在的路径是我的 TFS 工作区中映射的确切路径。我也尝试过这个,但这不起作用,
PS D:\Main Line> tfpt uu /recursive /noget 'D:\Main Line'
Unable to determine the workspace.
我认为它只是使用当前路径来解决它,但我无法让它正常工作。有谁知道这是如何工作的?
In using tfpt from the command, I'm getting the error:
PS D:\Main Line> tfpt uu /noget
Unable to determine the workspace.
Here I'm trying to use the Undo Unchanged command, but I've seen this error with other commands too. The path I'm at is the exact path that is mapped in my TFS workspace. I also tried this which doesn't work either
PS D:\Main Line> tfpt uu /recursive /noget 'D:\Main Line'
Unable to determine the workspace.
I thought it was just using the current path to figure it out, but I can't get it to work right. Does anyone know how this works?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我遇到了同样的问题,我在电源工具附带的帮助文件之一的页面底部找到了答案。 (TFPTCommandLineTool.mht)
错误
TFPT 错误:无法确定工作空间
使用与版本控制配合使用的命令运行 tfpt 时,您可能会收到以下错误之一:
解决方案:
tf.exe
工具位于 Visual Studio 安装文件夹的子文件夹Common7\IDE
中。如果启动 Visual Studio 命令提示符,则可以运行以下命令(这取决于您的 TFS/VisualStudio 版本 - 您应该使用与您正在使用的 TFPT 版本匹配的版本,例如,如果如果您有 VS2015 的 TFPT,请从 VS2015 命令提示符使用 TF):tf 工作区 /s:serverURL
tf 工作区 /collection:collectionURL
tf 工作区 /s:collectionURL
VS
I ran into this same issue, I found the answer at the bottom of the page in one of the help files that came with The power tools. (TFPTCommandLineTool.mht)
Errors
TFPT Error: Unable to determine the workspace
When running tfpt using a command that works with Version Control, you may receive one of the errors:
Solutions:
tfpt.exe
from within a directory that is already mapped to Team Foundation source control.tf workspaces
command. Thetf.exe
tool is available in the subfolderCommon7\IDE
of your Visual Studio installation folder. If you launch a Visual Studio command prompt, you can then run the following command (which depends on your versions of TFS/VisualStudio - you should use the version that matches version of TFPT you are using, e.g. if you have TFPT for VS2015, use TF from a VS2015 command prompt):tf workspaces /s:serverURL
tf workspaces /collection:collectionURL
tf workspaces /s:collectionURL
使用
tf工作区/s:serverURL
时,请确保使用正确的tf.exe
!我遇到了同样的问题并且被卡住了,因为我使用了来自以下位置的
tf.exe
:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE< /code>
而不是来自:
\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
When using
tf workspaces /s:serverURL
make sure you use the righttf.exe
!I had the same problem and was stuck because I used the
tf.exe
from:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
and not the one from:
\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
对于 Visual Studio 2017 用户,
我在安装了 VS215 和 VS2017 的全新机器上尝试运行
tfpt
命令行时遇到了同样的问题。在撰写本文时,tfpt
工具的最新版本来自 TFS 电动工具 2015。这意味着必须首先在 VS2015 中加载本地工作区映射,然后 tfpt 工具才能找到工作区。由于我的团队使用的是VS2017,因此我只在这个Visual Studio版本中进行了工作区映射。当我打开 VS2017 开发人员命令提示符以使用此工具时,我收到“无法确定工作区”消息。
为了解决这个问题,我打开了 VS2015 并将 Team Explorer 连接到 TFS 服务器。它立即识别在 VS2017 下制作的工作区映射。此后,
tfpt
工具可以在 VS2015 和 VS2017 开发人员命令提示符下正常工作。For Visual Studio 2017 users
I had the same problem when trying to run the
tfpt
command line on a fresh machine installation with VS215 and VS2017 installed. The latest version for thetfpt
tool at the time of writing is from TFS Power Tools 2015. That means the local workspace mapping has to be loaded in VS2015 first before thetfpt
tool can find the workspace.Since my team is using VS2017, I only did the workspace mapping in this Visual Studio version. When I opened the VS2017 developer command prompt to use this tool, I got the 'Unable to determine the workspace' message.
To solve this I opened VS2015 and connect the Team Explorer to the TFS server. It immediately recognizes the workspace mapping that was made under VS2017. After this the
tfpt
tool works correctly under VS2015 and VS2017 developer command prompts.我尝试了所有这些,但仍然遇到同样的错误。我猜这个错误很普遍,足以代表多个问题..
重新安装 TFPT
为我解决了这个问题。
I tried all of this and still i got the same error. The error is generic enough to represent multiple issues, i guess..
re-installing TFPT from
fixed the issue for me.
实际上,尽管我相信在某些情况下这些解决方法可能会解决问题,但它们并非在所有情况下都有效。我强烈怀疑这最终表明了 PowerTools 代码中某处可能被视为错误的地方。我这么说的原因是 tfworkspace 命令可以从 VS Command 控制台检测到我的计算机上的工作区,但是从具有所有相同路径信息的同一个控制台,TFPT 无法在我的笔记本电脑上检测到它。我尝试什么。我刚刚拿到这台笔记本电脑并安装了 VS 2010、2012 和 2013,以及各自的 Power Tools 安装,并指出了目前跨越多个 TFS 2010 和 TFS 2012 实例的一套项目。由于这种多对多关系,我怀疑某处存在不正确的程序集引用、GAC、路径、环境变量、VS 安装、TFS 存储库等因素的组合。在每个 VS 版本中,我尝试从 VS 2010 命令运行 TFPT 2010 可执行文件,对其余版本依此类推,并尝试了上述所有形式的工作区缓存更新...什么也没有。但是使用相同的项目,我从安装了 VS 2010 和 TFPT 2010 的旧服务器连接并完美运行相同的命令。所以我认为这与你的系统上运行的内容有关,将来我会对并行运行不同版本持更加怀疑的态度。
Actually, although I believe that in some cases these workarounds may fix things, they do not work in all cases. And I strongly suspect that ultimately this points to what could be considered a bug somewhere in the PowerTools code. The reason I say this is that the tf workspace command has no problem detecting the workspace on my machine from the VS Command console, but from that very same console with all of the same path info, TFPT cannot detect it on my lap top no matter what I try. I just got this laptop and installed VS 2010, 2012 and 2013, along with the respective Power Tools installs, and pointed to a suite of projects that currently spans several TFS 2010 and TFS 2012 instances. Because of this many-to-many relationship, I suspect there is an incorrect assembly reference somewhere, some combination of factors, GAC, Path, Environment Variables, VS Installations, TFS repositories. In each VS version I attempted to run the TFPT 2010 executable from the VS 2010 Command, and so on with the remaining versions, and tried the above workspace cache updates in all their forms... nothing. But using the same project I connected from an old server with VS 2010 and TFPT 2010 installed and ran the same command perfectly. So I think it has to do with what is running on your system, and in the future I will be much more skeptical about running the different versions side-by-side.