在 Visual Studio 插件中获取当前的 TFS 连接

在 Visual Studio 插件中获取当前的 TFS 连接

问题描述:

我正在开发 Visual Studio 2010 加载项,并且正在尝试弄清楚如何确定当前连接的 TFS 服务器.我猜我需要使用 DTE,但我脑子抽筋了,想知道从哪里获取信息.

I'm working on a Visual Studio 2010 add-in, and I'm trying to figure out how to determine the currently connected TFS server. I'm guessing I need to use DTE, but I'm having a brain cramp figuring out where to get the info.

我建议你查看 Microsoft.TeamFoundation.VersionControl.Client.Workstation.GetLocalWorkspaceInfo 方法,结果你有一个对象和访问 ServerUri 属性

I suggest you check out the Microsoft.TeamFoundation.VersionControl.Client.Workstation.GetLocalWorkspaceInfo method, in result you have an object and access ServerUri property

参见 有关详细信息,请参阅 MSDN 上的此文档.