tempid
tempid

Reputation: 8208

tfs build number - getting started

I have Visual Studio 2010 with Visual Studio 2010 Team Explorer. After I check in code, I can view the changeset number (View History). I typically put in the Changeset number in the bug log system as soon as I fix something. Now where/how do I get the build number? Is this a TFS admin thing? Where do I get started? Do I need to use MSBuild instead of using Visual Studio GUI?

Thanks for any help!

Upvotes: 1

Views: 1626

Answers (3)

pantelif
pantelif

Reputation: 8544

It seems that you haven't set up a TFS-build at all.
Even though this will require some time to grasp as a concept & tailor a solution to your own needs, this is definitely worth the investment (or, the other way around, NOT using TFS build makes the whole investment into TFS a lot less worth it).

This might be a nice starting point, there are a lot of useful resources out there, I 'd advise you to take a deep breath and dive right in. You can always return with more specific questions.

Upvotes: 0

KMoraz
KMoraz

Reputation: 14164

When creating a build definition, by default TFS labels each build with this format: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)

The Default Template's build number can be customized under
[build defintion] > Process > Basic > Build Number Format

However, you may want to check out Versioned TFS 2010 Build for more control over the build number format and automatic versioning of the assemblies (via AssemblyInfo.cs).

Upvotes: 2

Leblanc Meneses
Leblanc Meneses

Reputation: 3091

through gui:

right click on builds > view builds > tab to "completed"

build definition > all quality filter > all date filter > today

double click on the build of interest:

you should see the build number and changeset at the very top.

=========

When you commit you should use the dialog to associate your commit to a work item - this way you don't have to manually set any of this.

To get these details in msbuild the data can be retrieved using:

    <Exec Condition=" '$(IsInTeamBuild)'=='True'" Command="&quot;$(TfsTask)&quot; history ../ /r /noprompt /stopafter:1 /version:W > &quot;$(TemporaryFolder)\grab-changeset.txt&quot;" />
    <Exec Condition=" '$(IsInTeamBuild)'=='True'" Command="&quot;$(TfsTask)&quot; properties &quot;$(MyMSBuildStartupDirectory)\all-companies-run-after-update.js&quot; > &quot;$(TemporaryFolder)\grab-properties.txt&quot;" />

we use the above to extract: build#, branch, revision#

Upvotes: 0

Related Questions