Search code examples
visual-studiovisual-studio-2015tfsversion-controlvisual-studio-extensions

How can I create an extension for Visual Studio that can interface with TFS directly?


I am attempting to create an extension that will periodically check to see if the user has the latest version of all files in a specific project or branch. This specific project/branch is going to be determined by what item is checked out for editing. The reason for creating this extension is to create reminders every time a file becomes unsynced. This will prevent merging into items that are out of date.

I am also working with Gated Check-ins, so it would be advantageous if I could check for latest version after a gated build succeeds.

I am having trouble finding the APIs for TFS integration when making an extension for visual studio. I am also having trouble finding an API to use to make a direct TFS extension. I am assuming this is because everything that has to do with TFS commands should be done using TFS command line commands.

I am running TFS and VS 2015.

Thanks in advance for the help!


Solution

  • You can use NuGet packages of TFS API:

    Microsoft.VisualStudio.Services.Client

    Microsoft.TeamFoundationServer.Client

    Microsoft.TeamFoundationServer.ExtendedClient

    All the DLL's also stored in the following location, you can take them and use in your project:

     C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
    

    A good tutorial on how to use the API you can find here.