March 2009 Archives

Catching up with MIX09

| 1 Comment

MIX09Sadly, I couldn't go along to MIX this year. However luckily for me, Microsoft has followed a new trend with its conferences and made all the sessions available online for free for everyone to access.  As well as being able to browse the sessions online, Mike Swanson has posted a comprehensive list of all the sessions on his blog.  However, I like to download them all so that I have them locally and can watch them on the move (sat in airplanes or doing jobs around the house etc).  Therefore I created the following text file containing links to all the downloads so that I can copy the list of sessions into the excellent Free Download Manager to download them in the background over the next few days.  I thought that others might find the file useful so here it is:

mix09_content.txt mix09_content.txt (32KB)

Also, Mike has created a very handy MIX09 Renamer batch file (4.17KB) that can rename all the downloaded sessions to put the session title on them making them much easier to browse and find later.  For more information on this batch file see Mike's post.

If you use iTunes or Zune, then you can also subscribe to the MIX09 podcast feeds to download all the sessions to those devices (iPod/iPhone Friendly Feed, Zune Friendly Feed).

So far I am working my way through the sessions.  The Bill Buxton keynote is great, and I'm very excited about the new SketchFlow stuff in Blend.  Also - be sure to download session C02F - Improving UX through ALM (with Chris Bernard and Christian Thilmany) as they do a great job of showing the integration between the designer and the developer using TFS.  They also spend a good deal of time in Teamprise on the Mac :-)

Steven Borg Earlier this month I spent a very pleasant evening at the beautiful home of Steven Borg and recorded the chat we had about adopting Team System in the real world for this months episode of Radio TFS.

Steven Borg is the founder of Northwest Cadence, a Gold Certified Microsoft Partner focused on Visual Studio Team System.  He was selected as a VSTS MVP in the first round back in 2005, and has been a Team System MVP even since. He’s little ‘a’ agile, and big on understanding what makes successful development teams tick.  If you’re coming out to TechEd, be sure to head out a day early for his pre-con covering 5 ways real companies have gotten the most out of Team System.  Visit his blog at http://blog.nwcadence.com to learn more!

Play Now: Adopting Team System with Steven Borg

Big thanks to Michael Ruminer for lending me his fancy Marantz audio recorder which made this show possible.

Team System MVP of the Year

| 2 Comments

Martin Woodward: MVP Of The Year

This week I have been in Seattle for the MVP Summit 2009. It has been a busy week chatting with the Team System team and catching up with all my friends from the MVP community around the world.

I have to admit that, without doubt, my proudest moment of the week (and also the first time I think I have blushed in a while) was when it was announced that I had won the first ever Team System MVP of the Year award.  I am deeply honoured particularly because it was the 100 or so other VSTS MVP’s that made the decision.  As part of my “prize” I got a shiny belt buckle that I’ve been proudly showing off to anyone that will listen.  Dan Fernandez and Brian Keller were even kind enough to have me on their “This Week on Channel 9” show when I popped round to show off my award.

Take a look at the This Week on Channel 9 Episode, and don’t forget to subscribe to the show. When they don’t have me on it is usually a very entertaining 30 minute re-cap of the weeks events in the .NET world.

Nasty things start to happen on Windows systems when you start having paths that are longer than 254 characters. When NTFS is the underlying filesystem you can have up to 32767 unicode characters in the path, however in parts of Windows (and therefore .NET), a local file path (i.e. "C:\MyDir\MyFile.txt") is limited to 260 characters. Some older applications use 255 bytes for the path, while .NET's wrappers over the native file system API's seem to make the issue worse rather than better.

The problem is that this limitation is pretty easily bumped up against when performing a build as your build itself will use up a lot of those characters, and so if you start your build deep in a directory structure (i.e. using the default build working directory of "C:\Documents and Settings\username\Local Settings\Temp\Build Definition Name") then you quickly run out of room.  Aaron Hallberg has a great post talking about this in relation to build working directories - however at a recent customer, I ran into a similar problem because their build drop locations were quite long.

Deep Drop Locations

The CoreDropBuild target in Team Build is responsible for copying files from the $(BinariesRoot) folder to the Drop Location.  The Drop Location *must* be specified as a UNC path to a network share.  CoreDropBuild, the target in Team Build that performs the copying, uses the standard MSBuild Copy task which is implemented in .NET.

Some folks (especially large organizations with multiple domains) use fully qualified domain names for all their shares.  Also, they have a corporate standard directory structure.  Therefore they end up needing drop locations to be something like "\\servername.domain.company.com\Project\SubProject\Build Results\".  Now, UNC paths should not present a problem to us - the 260 character limit in a local path thing, UNC style paths should be able to go up to 32,767 characters.  However, the .NET API for file paths forces a 260 character limit even if the path is a UNC style path - if you try to copy files using the MSBuild Copy task into a deep drop location you will get the error:

"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."

Therefore to copy these files, we need to get out of .NET - fortunately MSBuild allows us to easily call other processes using the Exec task.  At first, I considered using the venerable xcopy. Xcopy has been around and since the early days of OS/2 and network aware MS DOS/Windows it has been able to copy to network shares using UNC style paths.  The only issue is that XCopy doesn't work well with a path greater than 254 characters.  If you try copying a folder to a path that takes you longer than that limit you get the following exception when you hit the long file:

Insufficient memory

Robocopy to the Rescue

In Windows Vista, XCopy has been depreciated in favor of Robocopy.  I have a somewhat one-sided love / hate relationship with Robocopy.  It can do nearly anything you would ever want to do with files (it is a bit like rsync for Windows platforms) - but the syntax for it is pretty painful to use. It also does strange things with the error codes that it returns.  That said it now ships by default with Vista and Windows Server 2008 - and it is also available as part of the Windows Server 2003 resource kit. More importantly, it can handle UNC paths longer than the 260 character barrier. Therefore we can override the default CoreDropBuild target that Team Build provides, with one that uses Robocopy as shown below:

<Target Name="CoreDropBuild">

  <Exec Command="robocopy &quot;$(BinariesRoot)&quot; &quot;$(DropLocation)\$(BuildNumber)&quot; /E /NP" IgnoreExitCode="true">
    <Output TaskParameter="ExitCode" PropertyName="RobocopyExitCode" />
  </Exec>

</Target>

Simply copy/paste that target into your TFSBuild.proj and hopefully you can have a long UNC path for your drop location that works.  That said - bear in mind that their are other parts of TFS that the long path could cause problems with.  For example, if the DropLocation path itself was getting really close to the 260 character limit then you will get problems accessing <DropLocation>\BuildLog.txt and the test results which get put in <DropLocation>\TestResults\. That said - for most people this should not be a problem and so the CoreDropBuild override method described above is the way to go.

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.