使用 C# 连接到 TFS 2010

本文关键字:TFS 2010 连接 使用 | 更新日期: 2023-09-27 18:30:23

我尝试使用 C# 连接到 TFS。 这是我的代码:

         Uri url = new Uri("http://serverpath/DefaultCollection");
        NetworkCredential nc = new NetworkCredential("ID", "Password", "Domain");
        TfsTeamProjectCollection coll = new TfsTeamProjectCollection(url, nc);
        coll.EnsureAuthenticated();

我收到以下错误:

 The underlying connection was closed: An unexpected error occurred on a receive.
Inner Exception : {"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."}

关于可能是什么问题的任何解决方案?

使用 C# 连接到 TFS 2010

您似乎缺少端口号和 URI 中的/tfs

通常,TFS 2010 URI http://server:8080/tfs/DefaultCollection