I\'m trying to find a more meaningful way to handle versioning for my app and I came acrossed this KB article
http://support.microsoft.com/kb/556041
Basically it
Yes it's a bit silly, Microsoft seems to have got it the wrong way round. AssemblyVersion
is used in the .NET assembly versioning system, so you should never auto-increment it, but AssemblyFileVersion
is written to the file version entry in the file's version resource, so you might reasonably expect it to always auto-increment by default.
I'm sure that there are some 3rd party build systems out there that can do this for you, but I just wrote a little command line C# app to do it, and it gets run on every project as part of our build process. It's very straightforward:
AssemblyInfo.cs
file line by line.RegEx
search for the AssemblyFileVersion
line, capturing all four version parts into separate capture groups. You could parse it yourself, but a regex will do all the detecting and parsing in one go, so it seems silly not to take advantage.