使用C#

时间:2015-07-16 16:17:06

标签: c# visual-studio tfs tfs2013 tfs-sdk

使用c#连接到tfsapi时出现以下错误。我有正确的凭据,url并添加了dll Microsoft.TeamFoundation.Client C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ ReferenceAssemblies \ v2.0

&安培; System.Net也是。有什么可能导致这个问题的建议吗?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Microsoft.TeamFoundation.Client;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Uri url = new Uri("https://");

            NetworkCredential nc = new NetworkCredential("", "", "");

            TfsTeamProjectCollection coll = new TfsTeamProjectCollection(url, nc);

            coll.EnsureAuthenticated();

        }
    }
}

错误: “Microsoft.TeamFoundation.Clientdll中发生了'System.Net.WebException'类型的未处理异常。附加信息:底层连接已关闭.Cound未建立SSL / TSL安全通道的信任关系”

enter image description here

0 个答案:

没有答案