Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用C连接到TFS 2010#_C#_Visual Studio 2010_Tfs - Fatal编程技术网

C# 使用C连接到TFS 2010#

C# 使用C连接到TFS 2010#,c#,visual-studio-2010,tfs,C#,Visual Studio 2010,Tfs,我尝试使用C#连接到TFS。 这是我的密码: Uri url = new Uri("http://serverpath/DefaultCollection"); NetworkCredential nc = new NetworkCredential("ID", "Password", "Domain"); TfsTeamProjectCollection coll = new TfsTeamProjectCollection(url, nc

我尝试使用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."}

关于可能出现的问题的任何解决方案???

看起来您缺少URI中的端口号和
/tfs


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

检查服务器日志可能重复。hmm!我无法查看服务器日志。。我没有访问它的权限。你知道服务器路径是否也需要端口号吗?在我的代码中,我总是包含端口号。不确定是否需要。另外,典型的VS 2010路径是“”。这就是问题所在的“路径”!现在可以了。谢谢向上投票