BM-Bloggers

The blogs of Black Marble staff

TFS Team Build compile details

Martin Woodward posted a few weeks ago about his build bunny. Now this is something I had tried a while ago for DDD4, but hit the same problem Martin had that the old Nabaztag API was too slow and messages could take hours to arrive, making it useless in the real world. Inspired by Martin and the new faster API I have been working on a new Team Build status monitor for the office.

Getting most of it going is straight forward as Martin said, the TFS API event model is easy to use. However I did have a problem getting the details of the build. I could see if it built or not, but I could not get any count of warning, code analysis errors or test results etc.

It seems the problem is that when the BuildQueue_StatusChanged event fires after a build completes it does not have all the details in the IBuildDetail object you would expect. However, if you re-query the TFS server you can get the information.

I added the following to the end of the BuildQueue_StatusChanged event handler:

// first get the handle to the queue (you might have this stored already)
TeamFoundationServer tfs = new TeamFoundationServer("http://myserver:8080");
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
IQueuedBuildsView buildQueue = buildServer.CreateQueuedBuildsView("MyProject");

// Now re query using the project build URL to get the number of errors and warning
// the array of string list what details we want
IBuildDetail buildDetails = buildServer.GetBuild(buildQueue.QueuedBuilds
         [lastItem].Build.Uri, new string[] {
              TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary,
              TeamFoundation.Build.Common.InformationTypes.TestSummary,
              TeamFoundation.Build.Common.InformationTypes.CodeCoverageSummary,
              TeamFoundation.Build.Common.InformationTypes.CompilationSummary},
              QueryOptions.None);

// Now use the new IBuildDetail object to update the screen associated display
// user control
this.display.UpdateStatus(buildDetails);

Now in my display usercontrol all I need to go is to extract compiler summary details using a standard TFS  InformationNodeConverter (and you could do the same for test or code coverage).

var buildSummaries = InformationNodeConverters.GetConfigurationSummaries(build Details);
if (buildSummaries.Count > 0)
{
  this.lblCompileReport.Text = "[Errors:" + buildSummaries[0].TotalCompilationErrors +
  "] [Warnings:" + buildSummaries[0].TotalCompilationWarnings +
  "] [Static Analysis Errors:" + buildSummaries[0].TotalStaticAnalysisErrors +
  "] [Static Analysis Warnings:" + buildSummaries[0].TotalStaticAnalysisWarnings +"]";
}

CA0055 error in FXCop

I have been setting up a new Team Build server today. All our projects are being set to do code analysis (FXCop) after the build. For one project this worked on the developer PC but failed on the build machine.

The CA0055 error means 'file not found' or 'could not load' the assembly to be analysed. Firstly I suspected there was a problem with path names being over 256 characters (both the assemblies and solutions names were long) which can be a problem MSBuild, but this was not the case.

In the end I looked in the *.CodeAnalysisLog.xml file in the build directory. This gave the inner exception and I found it was a missing DLL that was referenced by a DLL the main DLL referenced - so two hops away! I added this DLL to the project references to make sure it was in the build directory and all was OK.

TIP: read the detailed FXCop log file - it shows far more than the summary in the IDE

TechED 2008 IT in Orlando

I am just back from a week on the BizTalk Stand at TechED IT in Orlando, it was great to have the opportunity to chat to so many great people and to meet other BizTalkers.

 

I was privileged to meet some great people to name but a few

 

Mark Beckner author of the classic Apress BizTalk 2006 EDI book.

Todd VanNurden co editor of the legendary BizTalk Hotrod

Clint Huffman Microsoft PFE

Winston Woo

Ofer Ashkenazi , BizTalk Product Manager

Tim Wieman , BizTalk Ranger Team ( cool team name )

 

and great thanks to Michael Iem (Ziem Group Inc) who made the week go like clockwork.

 

Ewan Fairweather and Petr Kratochvil  announced the BizTalk Performance Guide , it is an essential read for any BizTalk project.

 

Despite daily thunderstorms and flying back on Friday the 13th , it was amazing fun , especially the Simpsons Ride @ universal  :)

 

b.

Catching Up

I've been far too busy lately and whilst there have been lots of things I wanted to post about, time has not been on my side. Before I start to forget some of the points I thought a quick post was in order.

  • @media 2008 was great. Slides and audio are just filtering onto the blog now. A highlight for me was Indi Young's talk on Mental Models. I now have her book on my desk (waiting for having the time to read it) and I'm excited about how the technique might interface nicely with the User Stories we use for feeding requirements into our Scrum development process.
  • Also at @media, I managed to catch up with Nick, who was as insightful as ever. He's on the lookout for a Cold Fusion developer, if anyone is interested.
  • On the food front, if you're down on the South Bank try Giraffe. Also not bad was the food at Auberge, not far from the IMAX.
  • One interesting point is that there was a lot of talk about 'agile methods' from the presenters, but I wasn't getting the impression that there was actually a great deal of understanding as to what they really entail. We use Scrum at Black Marble, albeit with some pragmatism as there are some things you just can't do when you're not working on time and materials. I find that the increased level of dialogue between team members that Scrum gives improves the execution of the project no end. If you want to know more about Scrum, Ken Schwaber's books are a good, quick read.
  • On the smartphone front, the iPhone 3G looks nice, but given my company infrastructure, the Touch Diamond looks more so. Also, the Diamond is nice and small which is something I've been searching for in a smartphone for a while. Big nod of respect to Opera - I have a beta of 9.5 on my TYTN right now and it's a very nice mobile browser. I'm looking forward to seeing what the polished product is like on the Diamond.
  • I have yet to get chance to install it, but the beta Power Pack for Windows Home Server is available which addresses the data corruption bug. I have a single disk in mine right now and to be honest it's not doing much other than backups, but I'd recommend one just for that - simple and straightforward image-based backups of all the PCs in the house. Great!

TFS Build server and running MSTest - directory creation error

When you create a build type for a team project on TFS you can enable testing using MSTest by saying 'run any tests that are found in a given DLL'. I used this today to create a CI build for a project, I am looking at using Team Build as opposed to CruiseCrontrol as we have done historically.

I hit a problem that the tests were running but the build was failing (or in Team build speak - partial succeeding i.e. compiling but not passed testing). On looking in the build log I saw the error was:

The results directory "\\server\tfsdrop\Rel1.0.0\TestProject_20080612.1\TestResults" could not be created for publishing

So this looked like a rights issue, but my Domain\TFSBuild user (which the build process runs under) has full permissions to the drop directory (and it's associated share) and it was happily creating the other directories for the drop share.

Turns out the answer was to also give the Domain\TFSService (used by the Appliction Teir) full access to the drop share. Once this is done all is OK

Go south young man.......and read a book on a SmartPhone

I have got into reading books off my HTC smart phone using the Microsoft Reader. It means you always have a book with you (as well as a web browser, blog writer, phone etc.....)

The problem has been getting books in a suitable format, yes I know that you can buy electronic books but there are so many out of copyright classic's I have not read yet. You can download many from Project Gutenberg (and convert them to the right format using the add-in for Word) so why buy newer ones?

So recently I have been re-reading one of my favourite books, a good one to dip in and out of, "The Worst Journey in the World" about Scott's last expedition which Paul Theroux describes it as the best adventure book he’s ever read. This obviously lead me to a book on the site I have not read before "The South Pole" by Roald Amundsen.

The first thing I have to say is that in my opinion Apsley Cherry-Garrard is a far better writer than Amundsen (this maybe the translation but I doubt it). Irrespective of the style the two books read very differently Amundsen just makes it sound so matter of fact almost easy. Much of this I think is down to being bought up in a snowy land - being prepared. Scott, as has been much written, made some strange decisions often based on his poor past experiences (such as the use of dogs) and was certainly unlucky as well. Scott's is a story of the Edwardian gentleman amateur.

However, it is also interesting to see the all Edwardians not just the English had a similar view of the world - to travel, find new creatures, kill them then eat and/or stuff them.

So how do I like reading using the SmartPhone form factor? Well I find it fine usually. The only problems are that the HTC is useless direct sunlight and on the cheap short haul airlines you can't switch your phone on even in flight mode. So buy a magazine at the airport.