Determining the version of TFS using the TFS object model

If you are building an extension using the TFS object model that is going to target multiple versions of TFS, you would most likely want to programmatically figure out the version of the TFS Server you are currently pointing at. Some of the API services introduced in the later version of TFS aren't available in earlier versions of TFS. Unfortunately, the API does not expose a property or function that will give you the exact version of TFS. In this recipe, you'll learn how to determine the TFS version programmatically.

Getting ready

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

Get Microsoft Team Foundation Server 2015 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.