Click here to Skip to main content
13,045,285 members (56,532 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 13 Sep 2011

TFS API: Using LINQpad to Query TFS

, 13 Sep 2011
Rate this:
Please Sign up or sign in to vote.
TFS API: Using LINQpad to query TFS

In this blog post, I’ll be showing you how to query TFS using LINQpad.

1. Download LINQpad

Those who are familiar with LINQpad know its benefits and ease of use. I would urge others to try it. You can download LINQpad and read more about it from here.

2. Download TFS SDK

I have a blog post on where and how to download the TFS SDK from here.

3. Querying TFS using LINQpad


  • Open LINQpad


  • Select Query Properties by selecting Query from menu bar and clicking on ‘Query Properties’. You could also press F4 to get to the query properties.


  • Add reference to TFS SDK DLLs, click ‘Browse’ and navigate to ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0’ and select the following references and click open.



  • At this point, you should be able to see the following in ‘Additional References’:


  • Click on Additional Namespace import and enter the following namespaces:
    • Microsoft.TeamFoundation.Client
    • Microsoft.TeamFoundation.VersionControl.Client
  • Change the Language to C# Program, the query window should look like below now:


  • Let's connect to the TFS server using the TFSTeamProjectConnectionFactory:
    void Main()
        var tfs = TfsTeamProjectCollectionFactory
    		(new Uri(""));
  • See the results window, LINQpad gracefully dumps the results for you, no worrying about parsing or binding the results.


Doesn’t that make querying TFS for information so much easier?


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Avanade
United Kingdom United Kingdom
Solution Developer - C# .NET, ALM

Tarun Arora is a Microsoft Certified professional developer for Enterprise Applications. He has over 5 years of experience developing 'Energy Trading & Risk Management' solutions using Microsoft Technologies. Tarun has great passion for technology and travel (not necessarily in the same order)!

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 13 Sep 2011
Article Copyright 2011 by Tarun_Arora
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid