Friday, January 18, 2008

Since I’m using TFS2008 for our project, I'm playing around with it to learn the product (Haven’t use before TFS really as I’m come from a CruiseControl.Net environment).

One of the new features in TFS2008 is annotation support. 

What is it?

It gives you support in the IDE of VS of Who did what and when.  You can click on the changeset number to get more detail about that change like which work items are associated, which source files and what the check-in comment is.

How to use it?

First you need to have Team Explorer installed.  Next in the solution explorer go to the class you want to annotate. 
Right click with your mouse.  In the popup you can choose “Annotate”.


After the code tab is visible with the Annotate information, click on the changeset number to open the detailed information.

To Annotate or not to Annotate?

The question is, will this feature a big help?  Well personally I think yes.  It will be a big help when the CI build breaks.  You could easily track the changes from within your VS IDE, instead of going to the source control, check for the history…

PS: For the diehards under us: the command prompt is still available.

TFS
1/18/2008 2:40:55 PM (Romance Standard Time, UTC+01:00)  #     | 
 Thursday, January 17, 2008

As I’m the responsible guy for the TFS 2008 server on our project, I started to add some custom policies to the check-in.  Later I also add the build server part.

You can use several check-in policies.  After talking with a few other colleagues and friends about which policies should be added, we came to following list, which is a kind of standard for most of the projects where they use TFS.

  1. Associate with your work item
  2. Last build must be successful.
  3. Mandatory add check-in comments
  4. Check if all methods have comment
  5. Code analysis

Some check-in policies are not by default installed.  So for those, we have to install them for each developer.  These are the tools/policies we need to install extra:

  1. Mandatory add check-in comments : Comes with the power tools.  Install only the Check-in policy pack on the developers machines.  Download it at http://msdn2.microsoft.com/en-us/tfs2008/bb980963.aspx.
  2. Code Comment Check-in policy (CCCP): download it at http://www.codeplex.com/TFSCCPolicy.  Be aware that the current version (v 2.1.1) doesn’t work with TFS 2008.  If you want to add this, they have currently following beta version 3.0.0.1 Beta 1.
Associate Work items with check-in

Why would add Work items with your check-in?
If a build breaks, it is important that you know what change sets are associated with this build and what work items those change sets are associated with. With this knowledge, you can identify the developer responsible for checking in the changed code and the area of the project on which he or she is working. 

For a build to be associated with a set of completed work items, each check-in must be associated with a work item. These check-ins are represented as change sets associated with the build, and it is possible to trace from build to change set to work item.

How do add this policy?
  1. In Team Explorer, right-click your team project, select "Team Project Settings", and then click "Source Control".
  2. Click the "Check-in Policy" tab.
  3. Click Add and then select and configure the "Work Item" check-in policy.
What gives this for the developers?

After they have changed their code and they want to perform check-in.  The check-in policy dialog appears.

When they press Check In, they got the message that not all policy requirements have been satisfied. 

They can check the policy warnings to see which policies they need to approve.

So to solve this, they have to go to the work items tab and choose their related work item.  By default the check-in action will state that the Work item is resolved.  But in case you still want to have the work item active, you need to change the Check-in action to Associate.

Last build must be successful

This policy requires that the last build was successful before the developer can check his code.  This is not the same as the standard Build policy.  The standard build policy is affecting the CI build.  If this build fails, developers can’t check in, till the problem is solved.
To add that the last build of the developer must be successful, we have to use a little trick.  We will use the Code Analysis policy, but without any rules selected.

This policy is makes sure that the developer at least check-ins a buildable change set.  Normally in this case our build server will not break on the build.

How do add this policy?
  1. In Team Explorer, right-click your team project, select "Team Project Settings", and then click "Source Control".
  2. Click the "Check-in Policy" tab.
  3. Click Add and then select and configure the "Code Analysis" check-in policy.
  4. In the settings, uncheck all rules and the option “Enforce Code Analysis For Managed Code”
What gives this for the developers?

When a developer wants to check-in his code which doesn’t build or isn’t a build after changing code on his machine, he will get a check-in policy error for the code analysis.

I will explain the other Check-in policies in my next blog post, so stay tuned.

TFS
1/17/2008 9:19:39 AM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, January 15, 2008

Standard this could not be done with TFS 2008.  But if you install the power tools  you will have a tool called “Find in Source Control” which allows you.  This gives you an addition to the Team Explorer menu that provides the ability to locate files and folders in source control by the item’s status or with a wildcard expression.

How to use this power tool?
  1. Open the source control explorer
  2. Right Click on a folder you want to explore
  3. Choose from the menu “Find in Source Control”.  This will show you a sub menu with following items: Status search, Wildcard search and changeset.
  4. In our example choose Status search
  5. You got a popup 
  6. Choose the default as we want to search for all checked out files and press “Find”
  7. This will give you a result like following image
  8. Here you can right click on an item.  You get a popup menu where you can checkout files, undo changes (including someone else’s changes if you have enough rights), view history, open the file and open the folder in Source Control Explorer
TFS
1/15/2008 3:49:25 PM (Romance Standard Time, UTC+01:00)  #     | 

As I'm a hugh fan of electronic music and especially Jean-Michel Jarre and Kraftwerk, I was suprised too see an annopuncment on my Live messenger about the latest concert of Jean-Michel Jarre in the Marigny Theatre in Paris.  You can see the clip here.

It's his latest concert together with the release of his latest Album "Oxygene Live in your Living Room".  This CD/DVD special gives you a 3D entertainment in your living room while listening/viewing the performance.  BTW this DVD is recorded @ the alfacam studio's in Belgium. And it's just great for watching.

1/15/2008 1:37:23 PM (Romance Standard Time, UTC+01:00)  #     | 
 Friday, January 11, 2008

The idea of my colleague Gill is great.  As I'm reading a lot of blogs it would be interresting to have a weekly list of links which are usefull, funny, handy.  Gill txs for the idea ;-).

News links :

VSTS

LINQ

Funny links :

1/11/2008 11:13:31 AM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, January 08, 2008

If you are working with Team System 2008, Microsoft has a few interesting tools you can download and use

  1. Visual Studio Team System Web Access 2008 Power Tool
  2. Visual Studio Team System 2008 Team Foundation Server Power Tools
TFS | VSTS
1/8/2008 1:30:05 PM (Romance Standard Time, UTC+01:00)  #     | 
 Monday, January 07, 2008

Roland Weigelt has released a new verison of his famous Ghostdoc.  It's a minor release but it solves a few issues with some operators and rules.

Download it form the Ghostdoc website.

If you want a easy and fast way to ahve standard documentation of your code this is a very nice product.  I'm using it now on several projects.

1/7/2008 3:49:18 PM (Romance Standard Time, UTC+01:00)  #     | 

Today we had a strange problem in our project.  One of my colleagues opens his solutions and he did a “Get Latest Version”.  Afterwards it seems that he lost his connection with the TFS.  All code was unbinded.

We checked if TFS was the default source control, which was true.  We want to manually bind his code again with TFS, which failed because there was no recognized server.

Me and another colleague had no problem with it, so we knew that the TFS server was working correctly.

Next we did following steps :

  • Removing the workspace and create a new one
  • Delete the local TFS cache

None of this worked.

As last step we removed the tfs server from the “Connect to team foundation server dialog box”, add again the server and now it works again.

We still don’t know what the problem was, but it was strange.

Update :

Txs to Gabriel Lozano-Moran I have more info on this problem.  It seems that this behavior is a bug in TFS 2008.  This happens when the TFS instance goes offline.  He also has a better solution too solve it.

More info can be found here : http://gabriel.lozano-moran.name/blog/PermaLink,guid,40ec1818-1e8a-45de-9111-7370544d3ba4.aspx.

TFS
1/7/2008 12:40:46 PM (Romance Standard Time, UTC+01:00)  #     | 
 Sunday, January 06, 2008

I got a strange error with Excel 2007.  I copy an existing XLSX file that I can open without any problems.  I rename the file and opens the copy of it.  Now I got following error

If I click "Yes" the file ops and I got following message

The log just mentioneing nothing special as the same error message.  When I want to save this file, the popup for a new filename is coming up.  I can overwrite the original copy without any problem.  Afterwards the file also opens without any problem. For the rest everything in the file is working.  When I copy this file again, the same problem comes up.  It seems that copying the file will make the file corrupt.

By searching the net I found several solutions which doesn't apply this problem.  There are no Pivot tables or links to external files in.  Only listvalues on another sheet in the same workbook.

If I copy the file to another disk, there's no problem.  It seems more a problem on the network disk I use. I already found something with the date time stamp of the file. Don't know for the moment what's wrong with it.  Have to look for it.

1/6/2008 8:41:26 PM (Romance Standard Time, UTC+01:00)  #     |