The GUID activity returns either a GUID or a Cryptographically Secure GUID. This can be stored in a build variable used wherever it is needed in your workflow. In this example we aim to show the the basic steps that are required to get the activity integrated into a build.

Before you can make use of any of the TFS 2010 community build activities you have to make sure they are available for the build system and on your development PC. Instructions for this process can be found in the ALM Rangers build guide or in the StyleCop page of this wiki. This page assumes the GUID activity is available in the developers build process workflow toolbox.

Step 1 Add some variables to store the GUID

First we need to create the variables to store the generated GUID. In most cases you will create a single string variable as you will want the GUI as either unformatted or formatted. In this case we want to see both so two variables

image_thumb[8]

Step2 Add the GUID activity

The GUID activity can be created anywhere in the build workflow.

In this sample we generate a GUID and then write it to the build log

image_thumb[6]

The only properties needed for the GUID activity are the output variables. You can choose if your Create a standard or secure GUID using the Action property, but this defaults to a standard GUID

image_thumb[11]

Next we written the GUID variable via a WriteBuildMessage activity

image_thumb[12]

 

Running the build

You should see something similar to the following the Build View Log, remember it will only be shown in the log, not the summary

Guid
Formated GUID is 5f473984-1a1a-43e5-98a0-cfd6e9a7fd54
Unformated GUID is 5f4739841a1a43e598a0cfd6e9a7fd54

Last edited Sep 24, 2011 at 5:07 PM by rfennell, version 2

Comments

No comments yet.