When we were using SVN, we'd always print at the footer of our pages: "Revision XXXX". I've been looking, but I can't figure out how to do the same thing with TFS. Can anyone offer some pointers?
In case this matters: we're using ASP.NET MVC. I'm guessing it doesn't matter, however.
You can use the default version system for assemblies to track revisions number without adding anything in TFS.
If you use the Major.Minor.*
format in your AssemblyInfo
's AssemblyVersion
attribute (e.g. [assembly: AssemblyVersion("1.0.*")]
) it will generate a version according to the following format:
Major.Minor.Build.Revision
where
This will give you an always increasing number which gives you precise information on build date and time.
To use these values in your code, you can simply recover the version using Assembly.GetExecutingAssembly().GetName().Version
.
You can update version number of projects in AssemblyInfo.cs
using assembly versioning tools/techniques like this. Version number of an assembly can be updated based on TFS changeset number. Version number then can be displayed in application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With