Saturday, February 14, 2009

Problems with getting the new TargetsNotLogged feature to work in VSTS2008 SP1

I guess many people have hade similar experiences as us since upgrading to TFS 2008 with build logs being way to verbose. Fourtunately SP1 fixed this problem for us like Aaron Hallberg describes in his post "Orcas SP1 TFS Build Changes".

Unfourtunately there was a misstake in this patch which lead to only the first project reference got eliminated (also described by Aaron in this post "TargetsNotLogged Hotfix Available"). But the good news is we have a hotfix (kinda obvious by the title in the above mentioned post).

So why the heck am I writing this post? Well as it turns out there seems to be a glitch in the installer when installing SP1 on a build server, the problem is that the new version of the file "Microsoft.TeamFoundation.Build.targets" is not installed. So what you need to do is to copy it from a development machine running any team edition and replace the one on your build servers, you can find the file under the following path: C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild.

Don't forget to make sure that you are copying the file from a machine that has SP1 installed.

UPDATE 2009-02-15: As Buck points out in the comment you only have this problem if you can keep your fingers out of the cookie jar :) (I know I couldn't) and have made any changes to your "Microsoft.TeamFoundation.Build.targets" file. If this is the case then the installer will not replace it since it doesn't consider it to be the same file since it used the original datestamp on the file when patching.

Also I missed that my good friend Mathias Olausson also posted some notes on this issue in particular he some info on how you could quickly verify if you have this problem or not which I completely forgot about:

open your "Microsoft.TeamFoundation.Build.targets" file and check that it contains the line <TargetsNotLogged Condition=" '$(TargetsNotLogged)' == '' ">GetTargetPath;GetNativeManifest;GetCopyToOutputDirectoryItems...
have a look a Improved build performance with Team Build SP1 + hotfix KB958845 to read the whole post.

2 comments:

  1. The way patching works for plain text files like Microsoft.TeamFoundation.Build.targets is that it will only get replaced if the date on the file is the same as it was at installation time. In other words, making any alterations to the file will result in the date being changed and it not being patched.

    DLLs don't have this issue because they have version numbers that the patching process uses to determine whether to replace them.

    Buck

    ReplyDelete
  2. Thanks for explaining the reason for why we had these weird problems, guess I only have myself to blame since I did do some minor modifications to get around some issues we had.

    /Peter

    ReplyDelete