visual-studio 如何使用 TFS 离线工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/934875/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:35:31  来源:igfitidea点击:

How to work offline with TFS

visual-studiotfs

提问by MPritchard

Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work!

我们的 TFS 服务器现在有一些临时连接问题,因此 VS 没有响应,导致 50 多个开发人员无法工作!

Is it possible to switch TFS into an offline mode in the event of such an issue?

如果出现此类问题,是否可以将 TFS 切换到离线模式?

采纳答案by rpattabi

There are couple of little visual studio extensions for this purpose:

为此,有几个小的 Visual Studio 扩展:

  1. For VS2010 & TFS 2010, try this
  2. For VS2012 & TFS 2010, use this
  1. 对于 VS2010 和 TFS 2010,试试这个
  2. 对于 VS2012 & TFS 2010,使用这个

In case of TFS 2012, looks like there is no need for 'Go offline' extensions. I read something about a new feature called local workspacefor the similar purpose.

在 TFS 2012 的情况下,看起来不需要“离线”扩展。出于类似目的,我阅读了有关称为本地工作区的新功能的一些内容。

Alternatively I had good success with Git-TF. All the goodness of git and when you are ready, you can push it to TFS.

或者我在Git-TF 上取得了很好的成功。git 的所有优点,当您准备好时,您可以将其推送到 TFS。

回答by tvanfosson

See this referencefor information on how to bind/unbind your solution or project from source control. NOTE: this doesn't apply if you are using GIT and may not apply to versions later than VS2008.

有关如何从源代码管理绑定/取消绑定解决方案或项目的信息,请参阅此参考资料。注意:如果您使用的是 GIT,则这不适用,并且可能不适用于 VS2008 之后的版本。

Quoting from the reference:

引用参考:

To disconnect a solution or project from source control

  1. In Visual Studio, open Solution Explorer and select the item(s) to disconnect.

  2. On the File menu, click Source Control, then Change Source Control.

  3. In the Change Source Control dialog box, click Disconnect.

  4. Click OK.

断开解决方案或项目与源代码管理的连接

  1. 在 Visual Studio 中,打开解决方案资源管理器并选择要断开连接的项目。

  2. 在文件菜单上,单击源代码管理,然后单击更改源代码管理。

  3. 在“更改源代码管理”对话框中,单击“断开连接”。

  4. 单击确定。

回答by Bernie Tschirren

The 'Go Offline' extension adds a button to the Source Control menu.

'Go Offline' 扩展在源代码管理菜单中添加了一个按钮。

https://visualstudiogallery.msdn.microsoft.com/6e54271c-2c4e-4911-a1b4-a65a588ae138

https://visualstudiogallery.msdn.microsoft.com/6e54271c-2c4e-4911-a1b4-a65a588ae138

回答by Richard Berg

plundberg: The "disconnect" button is only available for the TFS provider starting in VS 2008. Even then, I'm not sure if it's officially supported. The recommended way to use the Go Offline feature is to [re]open the solution.

plundberg:“断开连接”按钮仅适用于从 VS 2008 开始的 TFS 提供程序。即便如此,我也不确定它是否得到官方支持。使用 Go Offline 功能的推荐方法是[重新]打开解决方案。

Martin Pritchard: if you get stuck mid-operation, you can force VS to timeout by pulling the network plug (literally) or running ipconfig /release.

Martin Pritchard:如果你在操作过程中卡住了,你可以通过拔掉网络插头(字面意思)或运行ipconfig /release来强制 VS 超时。

Once you're marked offline, here's a step by step guide to working in that mode: http://teamfoundation.blogspot.com/2007/12/offline-and-back-again-in-vs2008.html

标记为离线后,以下是在该模式下工作的分步指南:http: //teamfoundation.blogspot.com/2007/12/offline-and-back-again-in-vs2008.html

More detailed info on tweaking the behind-the-scenes behavior: http://blogs.msdn.com/benryan/archive/2007/12/12/when-and-how-does-my-solution-go-offline.aspxhttp://blogs.msdn.com/benryan/archive/2007/12/12/how-to-make-tfs-offline-strictly-solution-based.aspx

有关调整幕后行为的更多详细信息:http: //blogs.msdn.com/benryan/archive/2007/12/12/when-and-how-does-my-solution-go-offline.aspx http://blogs.msdn.com/benryan/archive/2007/12/12/how-to-make-tfs-offline-strictly-solution-based.aspx

回答by demoncodemonkey

If you have a solution open, and TFS is down, you might have trouble going into offline mode. If you close and reopen your solution, a nice little dialog will appear asking you if you want to Go Offline.

如果您打开了一个解决方案,并且 TFS 已关闭,则您可能无法进入离线模式。如果您关闭并重新打开您的解决方案,会出现一个漂亮的小对话框,询问您是否要脱机。

Alternatively if you don't want to close/reopen the solution, (as suggested by Bernie) you can install the TFS Go-Offline plugin, then click:

或者,如果您不想关闭/重新打开解决方案,(如Bernie 建议的那样),您可以安装TFS Go-Offline 插件,然后单击:

TEAM -> Go Offline

回答by TJB

Depending on which tool windows you have open, VS may or may not try to hit the team server automatically when it starts up.

根据您打开的工具窗口,VS 可能会也可能不会在启动时自动尝试访问团队服务器。

For best results try this:

为获得最佳效果,请尝试以下操作:

  1. Close all instances of visual studio
  2. Open an empty visual studio (no project/solution)
  3. See which windows are opened by default, if source control explorer or team explorer or any other windows that use team are opened (and activated) by default, close them or switch them to a background tab.
  4. Close visual studio
  1. 关闭visual studio的所有实例
  2. 打开一个空的视觉工作室(没有项目/解决方案)
  3. 查看默认打开哪些窗口,如果源代码管理资源管理器或团队资源管理器或任何其他使用团队的窗口默认打开(并激活),请关闭它们或将它们切换到背景选项卡。
  4. 关闭视觉工作室

You should notice now that you can start visual studio without it trying to hit the TFS server.

您现在应该注意到,您可以启动 Visual Studio,而无需它尝试访问 TFS 服务器。

I know its just an aside to your problem, but I hope you find this helpful!

我知道这只是您问题的一个旁白,但我希望您觉得这有帮助!

回答by Mohamed Al-Hosary

Simply, change the root folder name for your solution in your local machine, it will disconnect automatically.

只需在本地计算机中更改解决方案的根文件夹名称,它就会自动断开连接。

回答by JonnyBasic

I just wanted to include a link to a resolution to an issue I was having with VS2008 and TFS08.

我只是想包含一个指向我在 VS2008 和 TFS08 中遇到的问题的解决方案的链接。

I accidently opened my solution without being connected to my network and was not able to get it "back the way it was" and had to rebind every time I openned.

我在没有连接到我的网络的情况下意外打开了我的解决方案,并且无法将它“恢复原状”,并且每次打开时都必须重新绑定。

I found the solution here; http://www.fkollmann.de/v2/post/Visual-Studio-2008-refuses-to-bind-to-TFS-or-to-open-solution-source-controlled.aspx

我在这里找到了解决方案; http://www.fkollmann.de/v2/post/Visual-Studio-2008-refuses-to-bind-to-TFS-or-to-open-solution-source-controlled.aspx

Basically, you need to open the "Connect to Team Foundation Server" and then "Servers..." once there, Delete/Remove your server and re-add it. This fixed my issue.

基本上,您需要打开“连接到 Team Foundation Server”,然后打开“服务器...”,然后删除/删除您的服务器并重新添加它。这解决了我的问题。

回答by user1703892

If the code has already been checked out by the user that if offline and they have the latest version on their local hd, then they just need to browse to the solution location and open the solution by double clicking sln file. The solution will open in disconnected mode.

如果代码已经被用户检出,如果离线并且他们在本地高清上有最新版本,那么他们只需要浏览到解决方案位置并通过双击 sln 文件打开解决方案。解决方案将以断开连接模式打开。