A Django site.
February 13, 2008
» Team Foundation Build 2008 API documentation

The documentation for the team build 2008 object model is now available as a CHM file.  Later this year, I'm told that the MSDN web site will be updated.

http://download.microsoft.com/download/5/f/8/5f872c2e-4221-410b-b86e-4c3cd831b0c4/Team Foundation Build Managed Reference.chm

After you download it you will need to right click it, choose Properties, and then select “Unblock” before you can view it.

This documentation is newer than what Aaron posted back in August.

The following are posts with examples of using the 2008 object model.

February 3, 2008
» Updated post on how to filter checkin emails by paths

I've made a significant update to the following post: Adding a path filter to a CheckinEvent subscription using bissubscribe.  The reason is that the paths supplied by the server aren't consistently cased while XPath is case-sensitive.  The result is that your subscriptions that filter based on paths will not work reliably without additional complexity, unfortunately.

November 21, 2007
» Martin Woodward's presentation on what's new in TFS 2008

Martin Woodward has a posted a great set of slides from a presentation he did on what's new in TFS 2008.  After going through all of the features other than build, he spends more than half of the slides on the build features of TFS 2008 (aka Team Build).  I highly recommend taking a look at the slides, particularly if you haven't paid close attention to TFS 2008 up to this point.

Team Foundation Server 2008 - What's New Talk

Last night I had the pleasure of presenting to my local .NET User Group (NIMTUG) on what is new in Team Foundation Server 2008.  Interestingly, most of the audience where new to TFS completely so I also covered a bit of ground on what Team Foundation Server did and why - however most of the talk concentrated on the Team Build stuff new in TFS 2008 and I ran through the wallboard demo that I wrote for TechEd.

more...

One of the slides shows a condensed diagram of the new object model for build in TFS 2008.  I've copied it here (you may need to make your browser wider to see the whole thing).  It does a great job of highlighting the central parts.

image

November 7, 2007
» How to list the team projects created with a particular template in TFS 2008

This question came up on an internal discussion, and I thought the answer would be useful to post.

Question

How we can find the list of projects created with the a particular VSTF template in Orcas (TFS 2008)? In VS 2005 TFS we can find out programmatically as well with the query but in the new version we are not able to do so.

Answer

Sam Heald, a developer on the work item tracking server team, responded with the following answer.

This information is no longer stored automatically in TFS 2008.

In TFS 2005, a templateId was returned as an out parameter of the GetProjectProperties method on the ICommonStructureService interface.

However, this templateId might not point to the same template used during project creation for that project (deleted/overwritten templates are purged, ids are re-used). Additionally, most project attributes initialized by the project creation wizard (aka PCW) can be customized or changed after the fact.

In TFS 2008, the templateId parameter always returns -1.

If you wish to simulate the old functionality, you can modify your process templates to put the template name in the generic project properties property bag. In the properties element in the classification.xml, you can define name-value pairs to be created at project creation time, e.g.:

<property name="TemplateName" value="MSF Agile v4.0" />

August 17, 2007
» TFS API: Determining if an edited file has changed

A few times over the last several months, the question has come up regarding how to determine whether a file on disk that is being edited is different that what is checked into TFS version control.  Folks looking at the PendingChange object have asked about the difference between the two hash value properties.

If you query for the pending changes in the workspace using GetPendingChanges() (or QueryPendingSets() if you don't want all of the pending changes for the workspace), you'll get an array of PendingChange objects.  The PendingChange object has quite a few properties.  Two of those properties are HashValue and UploadHashValue.  Unfortunately, the documentation on MSDN doesn't really do them justice.

The HashValue property is the right one to use if you want to determine whether a file with a pending edit has been modified.  HashValue is the MD5 hash of the content of the version against which the change was pended.  This value will be different from the MD5 hash of the file on disk, which you will need to compute yourself using MD5CryptoServiceProvider, if the file has been edited and actually changed.

I would recommend not using the UploadHashValue.  The UploadHashValue is the hash for the content last uploaded during a shelve or failed checkin operation.  This is used internally for the optimization to avoid uploading the same content repeatedly.  For example, a checkin may fail due to a conflict after all of the file contents have been uploaded.   To make subsequent attempts faster, the server keeps the content that was uploaded and the client checks to see if it needs to send the content when the checkin is attempted again.  The UploadHashValue is only really useful for this process.

Note that the GetHashCode() method is the standard .NET Object’s GetHashCode(), so it’s not relevant to the discussion of content hash values.

One caveat to computing hash values is that on systems where FIPS enforcement has been enabled, the MD5CryptoServiceProvider class cannot be used (it throws an exception), and TFS itself does not compute hashes when that is the case (the hash values are just used for upload optimization, so upload optimization is disabled).  You can learn more about FIPS enforcement at http://blogs.msdn.com/shawnfa/archive/2005/05/16/417975.aspx.  The summary of the issue is that FIPS standard only allows the SHA family of hash algorithms.

This post applies to TFS 2005 and newer.

August 16, 2007
» TFS 2008: Calling custom targets and documentation for the beta 2 object model

Aaron Hallberg has a written a great post on one of the new extensibility mechanisms we've added to the Microsoft.TeamFoundation.Build.targets file that forms the backbone of the msbuild process (it's imported by every tfsbuild.proj file and contains all of the targets and properties).  Aaron shows you how to have a different target called for each of the projects and solutions that you build, which allows for greater flexibility in hour your projects and solutions are built.

Calling Custom Targets Within Team Build

In Team Build v1 (VSTF 2005), the CoreCompile target always invoked the Build target of the solutions specified in the SolutionToBuild item group within your TfsBuild.proj file.  To support ClickOnce deployment, an additional item group called SolutionToPublish was supported - all solutions specified in this item group had their Publish targets invoked instead of their Build targets.  Team Build Orcas (VSTF 2008) generalizes this and allows custom targets to be specified for each solution in the SolutionToBuild item group (along with custom properties). 

      <SolutionToBuild Include="$(BuildProjectFolderPath)/path/MyClickOnceSolution.sln">
        <Targets>Publish</Targets>
      </SolutionToBuild>
      <SolutionToBuild Include="$(BuildProjectFolderPath)/path/MyStandardSolution.sln">
        <!-- <Targets>Build</Targets> -->
      </SolutionToBuild>
      <SolutionToBuild Include="$(BuildProjectFolderPath)/path/MyCustomProject.proj">
        <Targets>SomeTarget;SomeOtherTarget</Targets>
      </SolutionToBuild>
more...

By the way, even though the word "solution" appears in the name "SolutionToBuild," you can specify project files as well (e.g., foo.csproj).  It doesn't have to be a solution (we've kept the name "SolutionToBuild" from v1 for compatibility and because "SolutionOrProjectToBuild" just seemed like overkill).

Aaron has also posted a new CHM file that contains the documentation for the Orcas beta 2 Team Build object model: Orcas Beta 2 Object Model Documentation.  If you want to use the new API, you'll want this documentation file.

April 26, 2007
» Using an ASP.NET TFS data source

Kannan Sundararajan has written a couple of posts on how to use TFS as an ASP.NET data source.  If you are interested in displaying TFS data in ASP.NET-driven web pages, you'll want to check it out.

First he shows you how to build the data source and gives you the code that you need to build the dll.

TFS Data Source ASP.NET Control

While learning ASP.NET for developing the RTE for MSDN Forums I had to interact with multiple teams and provide them with status reports on the work items. Some of them were not using TFS yet for that code base. So I wanted a way to easily write a TFS report, send the url to all these teams.

Given my earlier TFS background and the capabilities I learnt exist in ASP world thought why not leverage these two and thus began this exercise to write a TFS Data Source ASP.NET control which I can drop into any ASP.NET web page, bind it to any existing ASP.NET controls to create a simple TFS report.

more...

Then he shows you what you can do with it and walks you through the steps of building a web page that uses the data source from the previous post.

TFS Reporting Simplified

In my last post we saw how to write a TFS Data Source Component. In this one I will explain how to use them to generate a TFS report like the one below leveraging existing ASP.NET controls.

more...

Enjoy!

tags: , , ,

April 23, 2007
» TFS Migration and Synchronization Toolkit pre-release published on CodePlex

Matt Mitrik, the program manager for the TFS migration tools, has announced the availability of the first pre-release version of the Team Foundation Server migration and synchronization toolkit.  If you are looking into how to migrate away from a different bug tracking or version control system, this is where you'll want to start.  Be sure to let Matt and company know what you need in order to be successful!

Migration and Synchronization Toolkit Prerelease Published on CodePlex

A prerelease of the Migration and Synchronization Toolkit has been released on CodePlex! If you are interested in seeing the progress that we have made to date, and are eager to try out the sample tools, please visit the project site on CodePlex at http://www.codeplex.com/MigrationSyncToolkit

more...

Brian Harry has also written a bit more about the future plans for the toolkit.

Migration and Synchronization Toolkit Prerelease

We plan to build or to work with 3rd parties to build integration between TFS and a variety of other systems.  In the toolkit, you'll find initial samples for synchronizing TFS with Sharepoint (both documents and work items/lists).  Ideas we are pursuing include:

  • Sharepoint synchronization - Allows you to leverage TFS's branching, merging, unified backup, etc while exposing all of your data through Sharepoint in a clean way.
  • TFS <-> TFS migration/synchronization - Enables a variety of scenarios, including a poor man's project move, multi-master replication for distributed teams who want local copies of all of the data and more...
  • Project Server synchronization - Making it easier to keep TFS and project plans in sync.
  • ClearCase migration/synchronization - Enabling the two systems to coexist nicely when needed.
  • And more...

more...

March 2, 2007
» How to enable a checkin policy via the version control API

I recently needed to test a new checkin policy that I wrote.  In order to do that, I needed to enable a checkin policy for the unit test's team project using the version control API.  I was a little surprised when it wasn't quite as obvious as I had hoped, and I had to poke around in the source to figure it out.  So, I thought I'd post the code snippet.

            using Microsoft.TeamFoundation.TeamFoundation.Client;
            using Microsoft.TeamFoundation.VersionControl.Client;


            TeamFoundationServer tfs = new TeamFoundationServer(http://yourserver:8080);
            VersionControlServer vcs = (VersionControlServer) tfs.GetService(typeof(VersionControlServer));


            TeamProject tp = vcs.GetTeamProject("SomeTeamProject");
            MyCustomPolicy customPolicy = new MyCustomPolicy();
            bool foundPolicy = false;
            foreach (PolicyType policyType in Workstation.Current.InstalledPolicyTypes)
            {
                if (policyType.Name == customPolicy.Type)
                {
                    tp.SetCheckinPolicies(new PolicyEnvelope[] { new PolicyEnvelope(customPolicy, policyType) });
                    foundCustomPolicy = true;
                    break;
                }
            }

            if (!foundCustomPolicy)
            {
                throw new ApplicationException("Something's wrong -- MyCustomPolicy is not installed");
            }

tags: , , ,

» Visual Studio 4.0 SDK is now available (includes updates to TFS extensibility documentation)

The Visual Studio 4.0 SDK was released today.  Here's the announcement.

On behalf of the VS Tools Ecosystem team, we are pleased to announce that after months of hard work, we have completed shipping the VS SDK 4.0 RTM release! We have done tons of work to make this release friendly to developers who are new to Visual Studio extensibility. It is available for immediate download on the Microsoft Download Center.

We are excited to present some of the new features included in this release:

  • VS SDK Browser – the new entry-point to the entire SDK; includes new QuickStart Tutorials and a completely revamped sample browsing experience
  • Package Load Analyzer – allows developers to easily debug package load failures
  • Toolbox Installer redistributable package – allows component vendors that simplifies deployment, along with sample
  • TFS Contents – new and updated TFS samples and documentation
  • Sandcastle – new set of tools for generating managed class library documentation (Sandcastle)
  • Updated Setup experience
  • And much more!

Here's what's new in it for TFS in particular.

Team Foundation Server Extensibility

  • New Work Item Custom Control API Sample and Help Documentation
    • Demonstrates how to use the Work Item Custom Control APIs introduced in Visual Studio 2005 SP1.
  • New Version Control Merge History API Documentation
    • Demonstrates how to use the enhanced QueryMergesWithDetails API introduced in Visual Studio 2005 SP1.
  • Updated Team Explorer PcwTESample
    • This sample can be found in \VisualStudioTeamSystemIntegration\Team Explorer and Project Creation\PcwTESample\.
    • Fixed problems that prevented the sample from building.
  • Updated Team Foundation Server Collectibles Sample
    • This sample can be found in \VisualStudioTeamSystemIntegration\Team Foundation Core Services\ExtendingTeamFoundationSample\.
    • Re-written to use best practices.
    • Updated ReadMe.doc to reflect new architecture.
  • All Team Foundation Server Pubic Assemblies Updated to Visual Studio 2005 SP1
    • These assemblies can be found in \VisualStudioIntegration\Common\Assemblies\.
  • Updated Team Foundation Server BisSubscribe.exe Tool
    • This tool was updated to the RTM version and can be found in \VisualStudioTeamSystemIntegration\Utilities\EventSubscriptionTool\.
    • The SDK version of this tool now provides unsubscribe capability.
  • Added Visual Studio Team Explorer Package GUID’s, Menu ID’s and Group ID’s Header Files
    • The newly provided header file contains the constants required for integrating with existing Team Explorer shortcut menus when you create Visual Studio Integration Package projects. The TFS_VC_IDs.h file can be found in \VisualStudioTeamSystemIntegration\Version Control\ and the TFS_WIT_IDs.h file can be found in \VisualStudioTeamSystemIntegration\Work Item Tracking\.

tags: , , , , ,

February 28, 2007
» Orcas March CTP is available now and includes new Team Foundation Server

Here's the announcement.  Please download the TFS Virtual PC image and let us know what you think.  Except for build scheduling, this CTP contains all of the new Team Build features, including continuous integration.

We are excited to announce that the Visual Studio Code Name “Orcas” March 2007 CTP is now available publicly to all customers! This CTP is being released as both a Virtual PC (VPC) image and Installable Bits for both VSTS and TFS.

If you wish to use the Virtual PC image you will need Virtual PC or Virtual Server to run this image. You can use Virtual PC 2004 or Virtual PC 2007 (2007 required to run the VPC on Windows Vista).  If you wish to use the self extracting install, we advise that you do not install this on a production machine. If you have Vista as the OS on your box, please only download the VPC.  In either case, depending on your hardware the download files make take between 30-60 minutes to decompress. 

Use the following links for step-by-step instructions on installing and using the VPC images or installable bits, links to the ReadMe and provide feedback.

The download page says that the password to the VPC image is P2ssw0rd (user is Administrator).  However, I'm betting it may be P@ssw0rd instead (that was the case on an internal VPC pre-release image that I tried).

Be sure to read all of the instructions for the CTP.  In particular, make sure you download the base VPC image (otherwise, the download won't be of any value to you).

Here's what's new for TFS in this particular CTP.  The download pages have the details for what's new in all of VS and VSTS (it's quite a lot).

  • Team Build (more detail)
    • Support multi-threaded builds with the new MSBuild.
    • Continuous Integration – There are many components to this, including build queuing and queue management, drop management (so that users can set policies for when builds should be automatically deleted), and build triggers that allows configuration of exactly how when CI builds should be triggered, for example – every checkin, rolling build (completion of one build starts the next), etc.
    • Improved ability to specify what source, versions of source, etc to include in a build.
    • Improved ability to manage multiple build machines.
    • Simplified ability to specify what tests get run as part of a build
  • Version Control support
    • Destroy- The version control destroy operation provides administrators with the ability to remove files and folders from the version control system. The destroyed files and folders cannot be recovered once they are destroyed. Destroy allows administrators to achieve SQL server disk space usage goals without constantly needing to add more disks to the data tier machine. Destroy also facilitates removing versioned file contents that must be permanently removed from the system for any other reason.
    • Annotate - Annotate is a feature that allows developers to inspect a source code file and see at line-by-line level of detail who last changed each section of code. It brings together changeset data with difference technology to enable developers to quickly learn change history inside a source file.
    • Folder Diff - Team Foundation Server now supports compare operations on folders, whereby the contents of the folder are recursively compared to identify files that differ. Folder diff can compare local folders to local folders, local folders to server folders, and server folders to server folders. It’s a great way of identifying differences between branches, files that you’ve changed locally, and files that have changed between two points in time.
    • Get Latest on Checkout - As an optional setting on a team project or on an individual basis, you can have Team Foundation Server always download the latest version of a file when you check it out. This helps ensure that you don’t have to merge your changes with somebody else’s when you check the file back in.
  • Performance and Scale
    • This release includes numerous improvements in performance and scalability of Team Foundation Server.

tags: , , , , , , , ,

February 27, 2007
» Jeff Atwood's Team Foundation Server Event Subscription Tool

Jeff has posted a nice GUI for creating event subscriptions.  This tool makes the process less arcane and error prone.  Check it out!

Team Foundation Server Event Subscription Tool

To set up advanced subscriptions, you needed to use bissubscribe.exe. This is problematic, because the command-line syntax is complicated, and also because bissubscribe.exe is only available on the Team Foundation Server.

To address this deficiency Naren posted a GUI tool that lets you create Work Item Event Subscriptions in July 2006. I took that tool and modified it so that it supports all event subscriptions, along with a bunch of other enhancements The new Team Foundation Server Event Subscription Tool is up on CodePlex now.

more...

tags: , ,

January 12, 2007
» TFSBuildManager - project on CodePlex

Lorenzo Barbieri wrote about a tool on CodePlex called TFSBuildManager.  I didn't know about this one.  It's a tool written by Dudu Shmaya.  The CodePlex project page has the following about the project.

TFSBuildManager

TFSBuildManager is a utility to manage Team Foundation build types in an environment other than Visual Studio.

Main Features
  • Start, stop a build
  • Change build/s quality
  • Delete, backup build/s
  • Edit build type
News
  • Release 1 Production is now available
Information

Looking at the screenshots, it looks quite useful.  There is a download from the releases page.

Dudu's blog has quite a few posts about using the Team Build web service.  Here are links to some of them.

tags: , , , ,

October 27, 2006
» A checkin policy to detect that the build is broken in a CI environment

One important aspect of Continuous Integration is getting notification that the build is broken.  One common way is via a desktop notification from an application like TfsAlert that listens for events (or polls if there isn't a TFS-style event notification mechanism).

Ideally, the build or unit test break would be noticed as soon as it happens, so that the problem can be fixed before other checkins pile up.  Clark Sell has come up with a checkin policy that detects that the last build failed and produces a policy failure when that happens.  That makes it pretty hard to say, "But I didn't know about the break."

Stop, the build is broken!!

It's late, your tired and yet somehow you got stuck fixing the build because junior engineer bob just fired off a check-in and took off.  It looks like the build is now broken because junior hasn't done a get latest in a month.  In the meantime 10 other people check-in and just end up compounding the problem.

Unfortunately things like this happen.  One day I just got so frustrated, I just wrote a custom TFS check-in policy which gets the last build status and validates a particular build type was actually passing before you check-in.

more...

I'm hoping Clark will post an attachment with the solution in a zip file.

The checkin policy has to make a web service call to find out the state of the last build.  The performance hit of multiple evaluation calls could be reduced by putting in a time window check or doing it asynchronously (checkin policies are expected to be really fast).  However, if you combine this checkin policy with his TfsAlert project and eliminate the call to the build service by changing the checkin policy to use the last build notification from TfsAlert (assuming TfsAlert has gotten at least one build notification), you get double coverage with better performance.

I think this CI checkin policy is a pretty cool idea.

[Update 10/30/2006]  Clark has posted a zip file containing the code in a VS solution, including a setup project.

tags: , , , ,

» Getting desktop notifications for TFS events

Clark Sell has created a home on CodePlex for a useful desktop notification tool called TfsAlert.

TfsAlert is a .Net 3.0 smart client which monitors for user selected TFS events and will display a balloon window in the Windows TaskBar Notification Area. It is built on top of WCF where you can subscribe to any TFS event you feel fit. It's initial focus is around Team Build management but will also include features around Work Item tracking.

You can get the code, but there's not a binary available yet.  This project is the result of his desire to have something equivalent to the desktop notification tool used with CruiseControl.NET.  Check it out -- and contribute to it!

[Update 11/2/2006] Clark has posted the first release!

tags: , , ,

October 3, 2006
» How to use the new Custom Controls in Work Item Forms (SP1)

Naren Datha<, a dev who works on the WIT client, has written a post on how to use the new work item tracking custom controls that are introduced in SP1 beta (he previously mentioned some ideas for custom controls).  He provides an overview, details on how to create custom controls, some hints for troubleshooting, and a sample in a zip file attached to the post.  Check it out!

How to use Custom Controls in Work Item Form

tags: , , ,