2

I want assemblies that are built in queue in build machine to have custom assembly details which helps us track in finding bugs. Ex I want file description of assembly to contain BranchName_Timestamp.rev_Changeset ex Live_20120301.7_12345

Suresh Balaji
  • 109
  • 2
  • 12

2 Answers2

0

See my answer in this post. Basically the best way is to index the sources with TFS. It's simple and you can debug easily (as long as you have the PDB along with the DLL/EXE)

Community
  • 1
  • 1
Nock
  • 6,561
  • 1
  • 28
  • 27
0
  • To get the timespam:

http://msbuildtasks.tigris.org/

<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Time" />

<MSBuild.Community.Tasks.Time Format="MM.dd.yyyy.HH.mm">
  <Output TaskParameter="FormattedTime" PropertyName="_time_spam" />
</MSBuild.Community.Tasks.Time>
  • To get the latest changeset:

https://stackoverflow.com/a/10252772/1268570

  • To get the name of the current branch:

You could check the following link

http://msdn.microsoft.com/en-us/library/dcbx5yce.aspx

Actually i have not tried to get the name of the current branch, the way we work is with labels instead of adding the name of the branch we add the name of the label and we label every time we release a new version, if you are interested in this approach, I built this functionality in NCastor AutoBuilder (I am planning a release in about one week):

https://github.com/jupaol/NCastor/tree/develop/Solutions/NCastor.AutoBuilder/NCastor.AutoBuilder.Runner/Targets/Labels

Putting all together:

<PropertyGroup>
  <InformationalVersion>$(SemanticVersion) $(BranchName)_$(_time_spam).rev_$(TFSRevisionVersion)</InformationalVersion>
</PropertyGroup>

<UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.AssemblyInfo" />

<MSBuild.Community.tasks.AssemblyInfo OutputFile="$(AssemblyVersionFilePath)"
          CodeLanguage="C#"
          AssemblyFileVersion="$(FileVersion)"
          AssemblyInformationalVersion="$(InformationalVersion)"
          AssemblyVersion="$(SemanticVersion)" />
Community
  • 1
  • 1
Jupaol
  • 21,107
  • 8
  • 68
  • 100