我尝试使用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."}
关于可能出现问题的任何解决方案??
答案 0 :(得分:1)
您似乎错过了端口号和URI中的/tfs
。
通常,TFS 2010 URI为http://server:8080/tfs/DefaultCollection
。