Getting Started

First of all you need to install Team Foundation Server 2013 and setup your project. And open your project from TFS.

Connect to Team Foundation Server
Image1.

Now select your project from the list.

select your project
Image2.

Connect project

document
Image3.

After connecting the project to TFS click on the Builds tab and click on New Build Definition.

New Build
Image4.

From here our main work starts. Enter the build definition name and description (optional) in the General tab setting. Queue processing should be enabled by default.

Queue processing
Image5.

Now select the trigger setting from the trigger tab.

select trigger
Image6.

Let's explain these triggers a little bit.

  1. Manual: Manual mode allows the Build to be triggered manually.

  2. Continuous Integration: This mode allows, on every check in into the source code control, a build and hence a deployment that we configure.

  3. Rolling Builds: Sometimes when working in big teams this mode can be disruptive since there are several checks that happen every other hour. In that case you can inform your development team that there will be a build happening every minute and they should plan for that. During the end game period of the project this configuration may help to have routine quick builds coming out.

  4. Gated Check-Ins: This is very important and useful mode for teams that did not want any broken builds due to bad check-ins. This will ensures that only check-ins that merge and build successfully.

  5. Scheduled Builds: As the name suggests you can also have builds coming out regularly every day. This is the model used by larger Visual Studio and .NET teams in general; we too get our builds created on a nightly basis.

Now select the source settings and select your project from the listing.

select source settings
Image7.

Now select the Build Defaults tab and check the build controller name and description.

Build Defaults
Image8.

Next you need to configure the process tab and browse your project solutions file in the projects property.

process
Image9.

The next tab shows the retention policy that indicates your build status.

shows retention policy
Image10.

Click save now. Here we are done with the settings. Now let's move to build now. As you can see there is one build definition that has been created.

build
Image11.

Right-click on the build definition and click Queue New Build.

click Queue New Build
Image12.

Click Queue button.

Click Queue button
Image13.

You can see two things in my build, one build has been started and the other one has not succeeded before. Now let's wait to complete the build.

complete the build
Image14.

The Green arrow indicates that the build has been successful.

Deployment Setting

Now let's do the final settings for deployment, you need to return to the Process (Image9) tab from edit build definition and put build arguments like this:

Deployment Setting
Image15.

The following explains the MSBuild arguments a little bit:

Now again queue new build and wait for complete.

queue new build
Image16.

Once it's complete with a Green arrow go to your deployment location, you can see all the files have been deployed there.