visual-studio 如何将 TFS 绑定添加到 Visual Studio 2010 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4190789/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add TFS bindings to a Visual Studio 2010 project?
提问by Simon
There's a question already discussing how to add project/solution bindings to TFS, however it seems to only apply to Visual Studio 2008 (I am unable to find the "Change Source Control" dialog in VS2010).
已经有一个问题在讨论如何将项目/解决方案绑定添加到 TFS,但是它似乎只适用于 Visual Studio 2008(我在 VS2010 中找不到“更改源代码控制”对话框)。
I have a solution and source code on my local machine already in TFS, however it does not have TFS bindings (the thing that produces the padlock icon in the Visual Studio Solution Explorer and allows automatic checkout).
我的本地机器上已有 TFS 中的解决方案和源代码,但是它没有 TFS 绑定(在 Visual Studio 解决方案资源管理器中生成挂锁图标并允许自动签出的东西)。
How can I add bindings to an existing TFS project using Visual Studio 2010?
如何使用 Visual Studio 2010 将绑定添加到现有的 TFS 项目?
回答by Gern Blanston
In VS2010 check Tools>Options>Source Control and see if set to TFS. If not that might be why you don't see File->Source Control->Change Source Control.
在 VS2010 中检查 Tools>Options>Source Control 并查看是否设置为 TFS。如果不是,那可能就是您看不到 File->Source Control->Change Source Control 的原因。
回答by PatrickV
I ran into this problem and, for me, the issue was that my solution was offline with respect to TFS. Upon trying to change source control, I received a message stating that it is already associated with source control but is offline. I placed the solution on-line, per my recollection, using the File->Source Control->Go Online menu option and this seemed to fix the problem.
我遇到了这个问题,对我来说,问题是我的解决方案在 TFS 方面是离线的。在尝试更改源代码管理时,我收到一条消息,指出它已与源代码管理关联但处于脱机状态。根据我的回忆,我使用 File->Source Control->Go Online 菜单选项将解决方案放到了网上,这似乎解决了问题。
回答by Ben Schwehn
I had the same problem and the following steps solved it for me in VS 2008.
我遇到了同样的问题,以下步骤在 VS 2008 中为我解决了这个问题。
Unfortunately, I didn't record the exact steps and don't want to add a new project to our TFS to try again, so the steps are from memory.
不幸的是,我没有记录确切的步骤,也不想在我们的 TFS 中添加一个新项目再试一次,所以这些步骤是凭记忆来的。
- Go to File Menu -> Source Control -> Open from source control
- Select solution file from TFS hierarchy
- Accept any warning about project already being on local disc
- A popup dialog comes up saying something along the lines "This solution is already under source control, but no bindings exist. Do you want to add them?"
- A selector shows all projects in a grid and allows adding the required bindings. Add TFS server setting to each project (select all lines in grid at once and press a button at the top. I can't remember what it was called, but it was fairly obvious).
- 转到文件菜单 -> 源代码管理 -> 从源代码管理打开
- 从 TFS 层次结构中选择解决方案文件
- 接受有关项目已在本地光盘上的任何警告
- 出现一个弹出对话框,上面写着“这个解决方案已经在源代码管理之下,但不存在绑定。你想添加它们吗?”
- 选择器在网格中显示所有项目并允许添加所需的绑定。为每个项目添加 TFS 服务器设置(一次选择网格中的所有行,然后按顶部的按钮。我不记得它叫什么,但很明显)。
回答by Ryan Hayes
Go to the source control explorer under Team Explorer, where you can see your repository. Right click on the top folder that maps to the folder on your local machine. There's an option called "Map to local folder". Map this to the folder on your local machine. This will set up all the bindings for TFS for your project.
转到 Team Explorer 下的源代码管理资源管理器,您可以在其中看到您的存储库。右键单击映射到本地计算机上的文件夹的顶部文件夹。有一个名为“映射到本地文件夹”的选项。将此映射到本地计算机上的文件夹。这将为您的项目设置 TFS 的所有绑定。

