Reputation: 34038
I created an asp.net mvc4 application and I have setup continuous integration and deployment to windows azure.
Because I have configured it to build after checkin, it would be very useful to print somewhere in the application which build is using.
I guess there should be a way with c# and msbuild api if it exists, which is the current build.
something like: FullStackSampleApplication_20130413.2
Any guidance would be really appreciated.
I found this line:
Update1: I added this to AssemblyInfo.cs
[assembly: AssemblyVersion("1.0.*")]
string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
This line is printing 0.0.0.0
Upvotes: 2
Views: 255
Reputation: 12654
To generate new build number and revision on each build, add to your AssemblyInfo.cs
[assembly: AssemblyVersion("1.0.*")]
The generated numbers will be based on build time. Build number will be the number of days since 2000, and revision number will be the number of seconds since midnight/2.
Upvotes: 4