“tf 工作空间"是什么?做? [英] What does "tf workspaces" do?

查看:34
本文介绍了“tf 工作空间"是什么?做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 tf.exe 执行 TFS 源代码控制任务 - 映射文件夹、获取文件.当前文件夹映射在工作区中,我已经检查过.以编程方式创建映射,然后调用 tf.

I'm using tf.exe to perform TFS source control tasks - mapping folders, getting files. The current folder is mapped in a workspace, I've checked. The mapping is created programmatically, then tf is invoked.

每当我在新机器上运行代码时,我都会收到以下消息:

Whenever I run the code on a new machine, I'm getting the following message:

无法确定工作区.您可以通过运行tf workspaces/collection:TeamProjectCollectionUrl"来更正此问题.

Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.

如果我执行那个命令,它会清理一切,从现在开始一切正常.但是,它究竟做了什么,我如何使用 TFS API 做同样的事情?

If I perform that command, it clears things up and everything works from now on. However, what exactly does it do, and how can I do the same using TFS API?

文档说它更新有关运行 Visual Studio Team Foundation Server 的服务器上的用户名或计算机名更改的缓存信息."我不明白 - 缓存在哪里?他们认为计算机名称更改是什么?

The docs say it "updates cached information about a user name or computer name change on the server that is running Visual Studio Team Foundation Server." I don't get it - where's the cache? What do they consider a computer name change?

调用 Workspace.Refresh() 或 Workspace.Update() 没有帮助.

Calling Workspace.Refresh() or Workspace.Update() doesn't help.

推荐答案

工作区缓存按客户端的(主要)版本保留,并且在版本之间不互操作.(由于 Visual Studio/TFS 2015 工作区缓存的格式可能与 Visual Studio/TFS 2013 工作区缓存的格式不同,因此 Visual Studio 2013 可能无法以向前兼容的方式读取该新版本.)

The workspace cache is kept per (major) version of the client, and those do not interoperate between versions. (Since the Visual Studio/TFS 2015 workspace cache may be in a different format than the Visual Studio/TFS 2013 workspace cache, and Visual Studio 2013 may not be able to read that new version in a forward-compatible way.)

因此,如果您使用 Team Foundation Server 2013 SDK 创建新工作区,它将在服务器上创建工作区将该信息放入工作区缓存中,以便后续调用具有无需从服务器读取该信息.

So if you're using the Team Foundation Server 2013 SDK to create a new workspace, it will create the workspace on the server and put that information in the workspace cache so that subsequent calls will have that information without having to read it from the server.

但是,如果您随后使用 Visual Studio 2015 附带的 tf.exe,它将无法在缓存中找到该工作区.它将需要连接到服务器以获取工作区列表 - 然后它将缓存以备将来使用,但同样在 TFS 2015 缓存位置中.

But if you then use the tf.exe included with Visual Studio 2015, it will not find that workspace in the cache. It will need to connect to the server to get a list of workspaces - which it will then cache for future use, but again, in the TFS 2015 cache location.

从广义上讲,您需要使用与命令行界面相同版本的 SDK.其他替代方法是仅使用 tf.exe 命令行界面创建工作区,而根本不使用 API.或者始终使用 API,从不使用 tf.exe.只有在混合搭配客户端时才会出现此问题.

Broadly speaking, you need to use the same version of the SDK as the command line interface. Other alternatives are to just create the workspace using the tf.exe command line interface and not use the API at all. Or to always use the API and never use tf.exe. This problem only occurs when you mix and match clients.

这篇关于“tf 工作空间"是什么?做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆