Tarun Arora

Visual Studio ALM MVP
posts - 58, comments - 187, trackbacks - 0

My Links

News


Tarun Arora is a Microsoft Certified professional developer for Enterprise Applications. He has extensively travelled around the world gaining experience learning and working in culturally diverse teams. Tarun has over 5 years of experience developing 'Energy Trading & Risk Management' solutions for leading Trading & Banking Enterprises. His passion for technology has earned him the Microsoft Community Contributor and Microsoft MVP Award.




View Tarun Arora's profile on LinkedIn

profile for Tarun Arora at Stack Overflow, Q&A for professional and enthusiast programmers

Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

TFS API: Using LINQpad to query TFS

 

Download Demo - LINQpad Query

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 => http://www.linqpad.net/

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

        image

  • 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.

        image

  • 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.

        image

        image

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

        image

  • Click on Additional Namespace import and enter the following namespaces

        - Microsoft.TeamFoundation.Client
        - Microsoft.TeamFoundation.VersionControl.Client

         image

  • Change the Language to C# Program, the query window should look like below now

        image

  • Lets connect to the TFS server using the TFSTeamProjectConnectionFactory
void Main()
{
    var tfs = TfsTeamProjectCollectionFactory
                .GetTeamProjectCollection(new Uri("https://tfs.codeplex.com/tfs/tfs34"));
    tfs.EnsureAuthenticated();
    tfs.Dump();
}
  • See the results window, LINQpad gracefully dumps the results for you, no worrying about parsing or binding the results Hot smile

        image

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

Share this post :

Print | posted on Monday, September 12, 2011 10:13 PM | Filed Under [ Power Tools TFS API TFS Utilties ]

Feedback

Gravatar

# re: TFS API: Using LINQpad to query TFS

Fantastic trick Tarun. I'm going to try using that instead of jamming .net code into powershell for quick inquiries.
9/13/2011 11:36 AM | Jason Int
Gravatar

# re: TFS API: Using LINQpad to query TFS

Thanks Jason, More often than not one is after simple answers and unless it is something overly client oriented i wouldn't get in to .net code or new reports, LINQpad makes this so easy and quick, and the queries are so easy to reuse and customize. :-)
9/13/2011 11:59 AM | Tarun Arora
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: