【发布时间】:2014-11-14 21:07:01
【问题描述】:
我尝试使用 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."}
关于可能是什么问题的任何解决方案??
【问题讨论】:
-
检查服务器日志。
-
嗯!我无法检查服务器日志.. 无权访问它。你知道服务器路径是否也需要端口号吗?
-
在我的代码中,我总是包含端口。不确定是否需要。此外,典型的 VS 2010 路径是“server:8080/tfs/DefaultCollection”。
-
这就是“路径”的问题!现在可以了。谢谢。赞成
标签: c# visual-studio-2010 tfs