Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Team Foundation Server 2015 Cookbook

You're reading from   Microsoft Team Foundation Server 2015 Cookbook Over 80 hands-on DevOps and ALM-focused recipes for Scrum Teams to enable the Continuous Delivery of high-quality Software... Faster!

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781784391058
Length 340 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Tarun Arora Tarun Arora
Author Profile Icon Tarun Arora
Tarun Arora
Tarun Arora Tarun Arora
Author Profile Icon Tarun Arora
Tarun Arora
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Team Project Setup FREE CHAPTER 2. Setting Up and Managing Code Repositories 3. Planning and Tracking Work 4. Building Your Application 5. Testing Your Application 6. Releasing Your Application 7. Managing Team Foundation Server 8. Extending and Customizing Team Foundation Server Index

Using Team Project Picker to connect to TFS programmatically


The TFS object model exposes a few options for connecting to Team Foundation Server. The Team Project Picker (TPP) is one of the options; the advantage of using the project picker is that the user sees a TFS connection dialog that they are familiar with. The user can specify the TFS Server details and authenticate using this dialog. In this recipe, you'll learn how to use the TPP to authenticate and connect to TFS programmatically.

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. Copy the following code into the Program.cs class in the newly created project:

    // Global Variables
    private static TfsTeamProjectCollection _tfs;
    private static ProjectInfo _selectedTeamProject;
    
    // Connect to TFS Using Team Project Picker
    public static void ConnectToTfsUsingTeamProjectPicker()
    {
    // The user is allowed...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime