Book Image

Microsoft Team Foundation Server 2015 Cookbook

By : Tarun Arora
Book Image

Microsoft Team Foundation Server 2015 Cookbook

By: Tarun Arora

Overview of this book

Team Foundation Server (TFS) allows you to manage code repositories, build processes, test infrastructure, and deploy labs. TFS supports your team, enabling you to connect, collaborate, and deliver on time. Microsoft's approach to Application Lifecycle Management (ALM) provides a flexible and agile environment that adapts to the needs of your team, removes barriers between roles, and streamlines processes. The book introduces you to creating and setting up team projects for scrum teams. You'll explore various source control repositories, branching, and merging activities, along with a demonstration of how to embed quality into every code check-in. Then, you'll discover agile project planning and management tools. Later, emphasis is given to the testing and release management features of TFS which facilitate the automation of the release pipeline in order to create potentially shippable increments. By the end of the book, you'll have learned to extend and customize TFS plugins to incorporate them into other platforms and enable teams to manage the software lifecycle effectively.
Table of Contents (16 chapters)
Microsoft Team Foundation Server 2015 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Getting the Process Template name for a Team Project programmatically


In this recipe, you'll learn how to get the name of the Process Template used to create a Team Project.

Getting ready

Follow the steps in the Acquiring TFS object model from the NuGet Gallery recipe to create a project in Visual Studio and add the TFS NuGet packages to this project.

How to do it...

  1. First, connect to TFS programmatically. As a first step, a connection to the TFS needs to be established. This can be done using the following snippet:

    var tfs = TfsTeamProjectCollectionFactory
                    .GetTeamProjectCollection(new Uri("http://tfs2015:8080/tfs")); 
    tfs.EnsureAuthenticated();
  2. To obtain the Process Template details for a Team Project, we need an instance of the VersionControlServer service and the Now instance to get ICommonServerService. The VersionControlServer service is used to get the project details, specifically, it is AbsoluteUri that we are after. AbsoluteUri for the Team Project is used by ICommonServerService...