locked
C# Access Team foundation server RRS feed

  • Question

  • User1225732310 posted

    I want to download files from Team foundation server, I saw its API, could you point me to the approach.

    I have tried below code as a start , I get the below error

    Team Foundation services are not available from server http://abc:8080/byc  Technical information (for administrator):
      Page not found.

    here is the code that i tried

     VersionControlServer vcServer;
               NetworkCredential myNetCredentials =  new NetworkCredential("abc", "123");
                ICredentials myCredentials = (ICredentials)myNetCredentials;
                TfsTeamProjectCollection tpc =  new TfsTeamProjectCollection(new Uri("http://abc:8080/byc"),  myNetCredentials);
                vcServer = tpc.GetService<VersionControlServer>();
                var teamProjects = new List<TeamProject>(vcServer.GetAllTeamProjects(false)); //Getting error in above line
    
                foreach (TeamProject projectNode in teamProjects)
                {
                   Console.WriteLine(projectNode.Name);
                    }
                Console.ReadLine();

    Regards

    Tuesday, August 7, 2012 3:52 AM

All replies

  • User700362322 posted

    have you tried by browsing http://abc:8080/byc .

    what is result? if server is available then it should ask for some credentials or show some page.

    Friday, September 14, 2012 9:05 AM