Manipulate TFS from VB.NET – a starter
Here is a quick script which demonstrates how to connect to TFS and get projects. Make sure you add reference to necessary dlls - Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client
Imports Microsoft.TeamFoundation.Client Imports Microsoft.TeamFoundation.WorkItemTracking.Client Imports System.Net Public Class Form1 Dim nc As NetworkCredential = New NetworkCredential("user", "pass") Dim tfsurl As New Uri("http://192.168.0.2:8080") Dim tfs As TeamFoundationServer Dim wis As WorkItemStore Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load tfs = New TeamFoundationServer(tfsurl.AbsoluteUri, nc) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click tfs.Authenticate() wis = tfs.GetService(GetType(WorkItemStore)) For Each proj As Project In wis.Projects If (proj.HasWorkItemReadRights) Then ListBox1.Items.Add(proj.Name) End If Next End Sub End Class
Related posts:
Tags: TFS























Leave a Reply
You must be logged in to post a comment.