如何从Team Explorer获取默认的TFS服务器? [英] How do you get the default TFS Server from Team Explorer?
问题描述
这样的调用需要服务器名称或网址:
A call like this requires the server name or url:
TeamFoundationServerFactory.GetServer("mytfsserver");
同样,我可以使用以下命令获取可用服务器或服务器名称的列表:
Likewise, I can use the following to get a list of available servers or server names:
TeamFoundationServer[] servers = RegisteredServers.GetServers();
string[] serverNames = RegisteredServers.GetServerNames();
但是如何获取Team Explorer用于连接的默认服务器?
But how do I get the default server that Team Explorer uses to connect?
或者,如果我可以获得当前的工作空间,我想我可以用它来获取正确的TeamFoundationServer进行连接.但是,我希望能够在加载解决方案之前执行此操作,这意味着我没有文件可用于查询其所属的工作空间.
Alternatively, if I could get the current workspace I think I could use that to get the correct TeamFoundationServer to connect with. However, I want to be able to do this before a solution is loaded which means I do not have a file to use for querying what workspace it belongs in.
推荐答案
请参阅以下内容: http://blogs.msdn.com/hippietim/archive/2006/03/29/563988.aspx
这篇关于如何从Team Explorer获取默认的TFS服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!