Book Image

Visual Studio 2013 and .NET 4.5 Expert Cookbook

Book Image

Visual Studio 2013 and .NET 4.5 Expert Cookbook

Overview of this book

Table of Contents (14 chapters)
Visual Studio 2013 and .NET 4.5 Expert Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating TFS-scheduled jobs


As TFS runs in the background, there is always a requirement to run scheduled jobs that perform a batch operation silently in the background. The TFS Background Job Agent is used to run certain tasks that can be hooked into the TFS system and that run automatically when scheduled.

Getting ready

Before getting started, create a library class and name it ScheduledJobs. We need to add a reference to the following files:

  • Microsoft.TeamFoundation.Framework.Server.dll located at C:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\Bin

  • Microsoft.TeamFoundation.Common.dll located at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0

  • Microsoft.VisualStudio.Services.WebApi.dll located at C:\Program Files(x86)\Microsoft Visual Studio 12.0\Common7\IDE\Reference Assemblies\v4.5

Once the setup is ready, let's write the scheduler logic first and later hook it into the TFS system.

We also create a new .NET 4...