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)

Version Info Code

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.