Reputation: 95
Quick question, is it possible to retrieve a Continuous Integration number / version number from TFS and use it as part of a site after building.
e.g. The latest version of an MVC project from the TFS is used as part of a demo. I would like to use the version number from the TFS inside the MVC application.
The version number displayed on-screen (in the footer perhaps).
The reason I would like to do this is to display - to the viewers of the demo - exactly which version they are viewing and how much has changed since the last version they saw.
I realize this is probably a silly question and I'm not positive that what I'm trying to do is practical / feasible.
P.S. I am at the moment using
[assembly: AssemblyVersion("1.0.*")]
from AssemblyInfo.cs and converting this to a readable date (e.g. 03/01/2014 17:28) to outline the version time of the project and displaying this on the Home page of my MVC project. This works fine.
Upvotes: 2
Views: 726
Reputation: 74177
Usually you configure your CI service so that the build
AssemblyInfo.cs
fileses, changing their AssemblyVersion
attributes to properly reflect the generated version/build numberEt voila! All your assemblies are properly marked with the correct version number.
At least, that's the way we've always done it. The specifics of this, of course, are entirely dependent on the specifics of
It's pretty straightforward with nAnt and CruiseControl.Net and most mainline source control systems. I imagine doing the same with other CI servers isn't much more difficult. If you're using more oddball source control, like Serena Dimensions, ClearCase or TFS, it might be a little more difficult.
Upvotes: 1