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.
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 atC:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\Bin
Microsoft.TeamFoundation.Common.dll
located atC:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0
Microsoft.VisualStudio.Services.WebApi.dll
located atC:\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...