代码之家  ›  专栏  ›  技术社区  ›  rupweb

配置TFS部署测试代理URI

tfs
  •  0
  • rupweb  · 技术社区  · 8 年前

    在TFS发行版定义中,我有一个部署测试代理任务,该任务在测试计算机上远程安装了一个测试代理,但随后无法连接回本地TFS服务器。

    我认为这是因为初始化作业环境变量,比如:

    [SYSTEM_TASKDEFINITIONSURI] --> [http://mypc:8080/tfs/DefaultCollection/] [SYSTEM_TEAMFOUNDATIONCOLLECTIONURI] --> [http://mypc:8080/tfs/DefaultCollection/] [SYSTEM_TEAMFOUNDATIONSERVERURI] --> [http://mypc:8080/tfs/DefaultCollection/]

    什么时候 mypc 实际上需要是承载TFS服务器的计算机的IP地址。如何设置这些变量,以便测试代理可以连接到TFS服务器?!

    然后,测试代理部署具有 TfsCollection 作为 (http://mypc:8080/tfs/DefaultCollection/) 因此远程测试代理会得到错误:

    Unable to connect to Team Foundation Server, Check if TFS is reachable from the test agent.

    System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "2" argument(s): "One or more errors occurred." ---> System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'mypc'

    1 回复  |  直到 8 年前
        1
  •  1
  •   Andy Li-MSFT    8 年前

    因此,问题是测试代理计算机无法访问TFS服务器。这应该是一个网络问题。

    只需检查路由或防火墙设置,以确保TFS服务器和测试代理计算机之间的连接正常。然后再试一次。


    更新:

    基于下面的RupWeb评论,解决方案是在 etc/hosts 要映射的文件 mypc 和TFS服务器 IP :

    只需添加以下条目 1.2.3.4 mypc ETC/主机 C:\Windows\System32\Drivers\etc\hosts 然后,远程测试代理可以通过其IP而不是DNS访问TFS服务器。