如何从 Team Explorer 获取默认 TFS 服务器?
像这样的调用需要服务器名称或 url:
TeamFoundationServerFactory.GetServer("mytfsserver");
同样,我可以使用以下命令来获取可用服务器或服务器名称的列表:
TeamFoundationServer[] servers = RegisteredServers.GetServers();
string[] serverNames = RegisteredServers.GetServerNames();
但是如何获取 Team Explorer 用于连接的默认服务器?
或者,如果我可以获得当前工作区,我想我可以使用它来连接正确的 TeamFoundationServer。 但是,我希望能够在加载解决方案之前执行此操作,这意味着我没有可用于查询它所属的工作区的文件。
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();
But how do I get the default server that Team Explorer uses to connect?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅以下内容: http://blogs.msdn.com/嬉皮蒂姆/archive/2006/03/29/563988.aspx
See the following: http://blogs.msdn.com/hippietim/archive/2006/03/29/563988.aspx
不确定默认值(这只是 VS 上次保存其配置时连接到的服务器 Team Explorer),但您可以获取具有到当前文件夹的映射的服务器。
Not sure about default (which is simply the server Team Explorer was connected to the last time VS saved its configuration), but you can get the server with a mapping to the current folder.