0

I get the following error when connecting to tfsapi using c#.I have the right credentials, url and added the dlls Microsoft.TeamFoundation.Client from C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0

& System.Net too. Any suggestions of what might be causing the issue ?

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();

        }
    }
}

Error : "An unhandled exception of type 'System.Net.WebException' occurred in Microsoft.TeamFoundation.Clientdll Additonal information : The underlying connection was closed. Cound not establish trust relationship for the SSL/TSL secure channel"

enter image description here

CodeNinja
  • 3,188
  • 19
  • 69
  • 112

0 Answers0