Pages - Menu

Setup Jenkins on TFS 2008 for MSBuild project


Download TFS plugin from

Download MSBuild plugin from

You may go to the jenkins-ci wiki page to download the plugin manually or it can be downloaded via Manage Plugin page, either way is fine.

Install plugin under Manage Jenkins.

Now TFS is available as an option in Source Code Management.

Plugin can also be found and installed by using the plugin manager.

Troubleshooting during installation

The following error maybe encountered if TF.exe is not installed or path to access TF.exe is not configured in Jenkins.
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\jobs\XXX\workspace
[workspace] $ tf workspaces -format:brief ******** Cannot run program "tf" (in directory "C:\Program Files (x86)\Jenkins\jobs\XXX\workspace"): CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessBuilder.start(Unknown Source)
 at hudson.Proc$LocalProc.<init>(
 at hudson.Proc$LocalProc.<init>(
 at hudson.Launcher$LocalLauncher.launch(
 at hudson.Launcher$ProcStarter.start(
 at hudson.plugins.tfs.TfTool.execute(
 at hudson.plugins.tfs.model.Server.execute(
 at hudson.plugins.tfs.model.Workspaces.getListFromServer(
 at hudson.plugins.tfs.model.Workspaces.populateMapFromServer(
 at hudson.plugins.tfs.model.Workspaces.exists(
 at hudson.plugins.tfs.actions.CheckoutAction.checkout(
 at hudson.plugins.tfs.TeamFoundationServerScm.checkout(
 at hudson.model.AbstractProject.checkout(
 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
 at jenkins.scm.SCMCheckoutStrategy.checkout(
 at hudson.model.AbstractBuild$
 at hudson.model.Run.execute(
 at hudson.model.ResourceController.execute(
Caused by: CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessImpl.create(Native Method)
 at java.lang.ProcessImpl.<init>(Unknown Source)
 at java.lang.ProcessImpl.start(Unknown Source)
 ... 20 more
Finished: FAILURE

The missing file can be downloaded in here.

Install in progress….

The following error maybe encountered if path to TF is not given.

The next step is to tell Jenkins where TF is. In Jenkins –> Configure System, depends on the version of .Net Framework, apply the path as follow.

Setup for MSBuild Project

Once the Jenkins is setup, by default it is only getting the files. The next step is to setup the MSBuild for the project.

In [Project] –> configuration –> Build –> Add build step, we will setup as follow.

Add build step will now have an option to use MSBuild.

As described in the jenkins-ci wiki page, we need to configure the MSBuild. A simple setup for .Net framework 4.0 as follow.

Trigger a build from check in

Perhaps, one of the most interesting feature of CI is the ability to continuously ensure the integrity of the build. Hence the name continuous integration. With the ability to trigger a build from any check-ins from developers, we have immediate feedback if any piece of check-ins causing troubles. This can be achieved by polling the SCM periodically. The online help with Jenkins is quite comprehensive, it follows the cron syntax.