I'm trying to create a page where I will be getting all the Workitem in the tfs. But I don't know how to Connect to TFS. what reference I need to add currently my code is ( which I get from internet ).
NetworkCredential credential = new NetworkCredential("username", "password");
BasicAuthCredential basicCred = new BasicAuthCredential(credential);
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
new Uri("https://project.visualstudio.com/DefaultCollection"),
basicCred);
tpc.Authenticate();
First of all, add this library using nuget:
Also you need this namespace, so you should add it to the page:
Then you can connect to TFS with following code: