Deepak Jain
Deepak Jain

Reputation: 137

Get all the project list in TFS in C# asp.net?

i am making a asp.net web form in which i needed all the Projects which are there in TFS after authentication which i have already done by the below code

var collectionUri = new Uri("https://project.visualstudio.com/DefaultCollection");

var credential = new NetworkCredential("username", "password");
var teamProjectCollection = new TfsTeamProjectCollection(collectionUri, credential);
teamProjectCollection.EnsureAuthenticated();

Upvotes: 1

Views: 443

Answers (1)

Rahul Singh
Rahul Singh

Reputation: 21795

You can simply write a Linq query like this:-

WorkItemStore workItemStore = new WorkItemStore(teamProjectCollection);
var project = (from Project pr in workItemStore.Projects
               select pr);

Upvotes: 2

Related Questions