Getting the date and version of an assembly
filed in HowTo on Nov.29, 2009
So, i have been busy working on code for Torrent Helper (still looking for a proper name and URL) and one of the things i wanted to add was a version number footer… ust for the laugh, just cause i could… But how? So, this is how you do it…
First, you need to modify the AssemblyInfo.cs file in your project (I have 2 projects, my website and my backend service). In here i set the AssemblyVersion and AssemblyFileVersion to 0.1.*. The * tells the compiler to magically build the number…
Next, how do you get it back out programatically? (click to see the larger version)
As you can see, i have 2 functions here. one (PrintBuild()) is called by the web site where i want to put the data (I know this is not pretty, but its working… maybe some dat i will changed it… the second functions only job is to get the information about the assembly and work out the date and time it was built… Any questions, leave a comment.
December 12th, 2009 on 8:28 am
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
December 12th, 2009 on 9:28 am
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.