Author Archive

Thursday, December 22nd, 2011

Before starting with how to achieve continuous integration with TFS, lets try and understand why it is required?

Wiki says:

In software engineering, continuous integration (CI) implements continuous processes of applying quality control — small pieces of effort, applied frequently. Continuous integration aims to improve the quality of software, and to reduce the time taken to deliver it, by replacing the traditional practice of applying quality control after completing all development.

Which is very true!

And the principles of continuous integration are :

  1. Maintain a code repository
  2. Automate the build
  3. Make the build self-testing
  4. Everyone commits to the baseline every day
  5. Every commit (to baseline) should be built
  6. Keep the build fast
  7. Test in a clone of the production environment
  8. Make it easy to get the latest deliverables
  9. Everyone can see the results of the latest build
  10. Automate deployment

If you can think for a while how every stuff adds value and helps in getting the quality product out at a higher rate by reducing risk you have already 50% through with the process. Rest all is matter of utilizing the feature provided by the CI tools/infrastructure.

Lemme start with maintaining code repository. If you follow few guidelines, it makes the life much easier to maintain the code. It all depends on nature of the application & process you follow.

Define your environments:

Defining branching is major decision to be taken and it all depends on the scenario or the process you are in. Go throw this site before strategizing the branching

For instance, lets consider a simple branching strategy around environments (dev,qa & prod) with single release.

Define environment dependant configuration:

First and foremost, define the configurations for each environment. Configurations as such, DB to point, service url to refer, user accouts to be used etc. This can be achived by having a configuration file each environment.

1.       Select the solution

2.       Right cick -> configuration manager

3.       Define the configuration for all environments (and debug/release modes for local settings & dev workarounds) -> Using Configuration Manager

4.       Make use of the interesting feature Add Config Transforms offerred by VS2010/.net4.0 web application project template to maintain web.config for each configurations.

5.       Strangly we don’t have this luxury for other application templates. Thr is a combursome procedure of modifying your cs proj file to achive this feature (refer:

I prefer to write a small batch scripts which overrides the app.config  befroe the build. Call the batch script on pre-build event of the project.

Define TFS build for each environment:

TFS2010 has very strong and extensible support for build J. Its easy and scallable. You can get a smiple build procedure up, by following the new build wizard

1.       Go to team explorer in VS 2010 ->  Builds -> New Build Definition

2.       Define the build for dev environment.

a.       Name

b.      What triggers the build. Notice the interesting scheduling options J

c.       For which solution?

Path of the soultion to build. You can have multiple solutions build on same time. Have an eye on Build Agent Folder path.

d.      Need to drop the output of the build to a location? Oh yeah, you can do it in build defaults.

e.      Here comes the most important step of build definition, the Process.

f.        Quick tips:

i.      As I stated earlier, we will be having a different builds for each environment. Now it’s the time for chosingthe configuuration we defined. Provide appropriate configuration name for the property Configuration to  Build.

ii.      Want to run the unit testcases? Provide the assemblies for the propert “Test Assembly Filesspec”.

iii.      Want to fail the entire build on test fail even if the compliation was successful ? set “Fail Build On Test Failure” to true

iv.      Want to run the code coverage? Enable code coverage (refer): and provide the local.testsettigns file to “TestSettingsFile”.

v.      Want to run the Code Analysis on the build? Set the “Perform Code Analysis” option. Make sure, you have selected appropriate rulesets in the project (refer:

vi.      Want to deploy the application? (Only Web Apps) Provide publish parameters to “MSBuild Arguments





/p:DeployIisAppPath=”Default Web Site/WebApplication1″



vii.      How to deploy web or any other applications? This is a generic process, invbolves writign some batch scripts J

Ref :

g.       You define the rention policy too.

This ends defining the build for a specific environment. Repeate the above steps for other 2 environments/branches with environment specific details such as ,

1.       Solution location

2.       Scheduling

3.       Drop location

4.       Configuration to run

5.       Enablingor disabling of Automatic deployment, Runnign unit test, code coverage or any other details.

Once we have have all the 3 build definitions defined, we can view, enquue,delete or modify the build.

Click onView Builds to see all possible builds

Click Open to explore  different features provided and majorly to see what happened with the build.

Opt for alerts to be on track with build status by selecting Project alert option under “Team” menu in toolbar.

Tuesday, December 20th, 2011

I was told to write blogs many times in many ways! I always wanted to write a blog too. And I did write few on an average of one blog/year. I was never motivated to write blogs. But then, one day I had really interesting conversation with couple folks at my work place. Even that did not motivate me to write a blog, but that conversation made me ask myself lot many question about writing blog.

The answer I got back was, It was not about writing blog. It’s more about telling a story, sharing an experience and I read somewhere “if you don’t tell your story then who will?” I think, that makes a lot of sense! Ironically, I got that from a blog!

So, I decided to write this blog to talk about why to write a blog or tweet.

I know, most of us are fascinated by history. It amazes surprises and even horrifies us.  What is the biggest take from history the current generation is enjoying? “The lessons learnt”. So, how did we receive all these information? Was these things told to us by our ancestors? How? As stories? How did they communicate their experiences to us? Who told us?

What would have happened, if everybody has seized their knowledge to themself? Lemme not elaborate too much, you know what I’m talking about!

You have learnt something from the community you are in. It’s your responsibility to give it back! We living in the digital world should be very lucky that we can contribute back without much effort. And that need a not be a blog!

Communication is important. How do you communicate effectively is even more important. The best way of communication is make use of the digital world u live in. It is fine, if you write a book! It’s fine, if you click a pic! Don’t miss to tell the story! Whatever it might be, something which has a flavor is always stands out! You story has a flavor, share it! Just, casually share your thoughts “If you don’t tell your story then who will?”

Category: General  | Leave a Comment
Monday, March 21st, 2011

I have written a blog about TDD here

Please drop in your comments & opinion.

Category: .Net  | Leave a Comment
Thursday, March 17th, 2011

Ever came across an error saying “An error occurred while signing: Keyset does not exist” while building??

Well, if so i’m sure you would not have got the answer quickly. It took quite a lot of time to figure what was the issue. It was difficult to figure out solutions, as the project builds perfectly fine but fails if MsBuild/TfsBuild is trying to build.

The main reason behind this is, mis match in the sign file or the pfx file with the certificate being installed on the machine.

One of fixing this is by simply deleting the certificate as mentioned here

Well, that did not work for me. So tried recreating the pfx file and it worked like a charm 🙂

Project Properties

Go to project properties, and select the pfx file if you already have the older correct version. Else delete and create a brand new one! Hope this helps.