<p>I've inherited a .NET application that automatically updates it's version number with each release. The problem, as I see it, is the length and number of digits in the version number.</p>

<p>An example of the current version number format is <code>3.5.3167.26981</code> which is a mouthful for the users to say when they are reporting bugs.</p>

<p>What I would like is something more like this: <code>3.5 (build 3198)</code>. I would prefer to manually update the major and minor versions, but have the build number update automatically.</p>

<p>Even better, I don't want the build number to increment unless I am compiling in RELEASE mode.</p>

<p>Anyone know if there is a way to do this -- and how?</p>

[{'answer_id': 40788, 'author': 'Brian Stewart', 'author_id': 3114, 'author_profile': 'https://Stackoverflow.com/users/3114', 'pm_score': 0, 'selected': False, 'text': '<p>At a previous company we did something like this by writing an Ant task to get the current Subversion changeset string, which we used as the build number, appended after the major, minor, and tertiary numbers. You could do something like this with Visual Studio as well.</p>\n'}, {'answer_id': 40791, 'author': 'McKenzieG1', 'author_id': 3776, 'author_profile': 'https://Stackoverflow.com/users/3776', 'pm_score': 0, 'selected': False, 'text': '<p>Use a \'*\' wildcard in the AssemblyVersion attribute. Documentation is <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx" rel="nofollow noreferrer">here</a>. Note that if the application is built from multiple assemblies, the version you care most about is the one for the .exe.</p>\n'}, {'answer_id': 40793, 'author': 'Joseph Daigle', 'author_id': 507, 'author_profile': 'https://Stackoverflow.com/users/507', 'pm_score': 3, 'selected': True, 'text': '<p>In one of the project files, probably AssemblyInfo.cs, the assembly version attribute is set to <code>[assembly: AssemblyVersion("3.5.*")]</code> or something similar. The * basically means it lets Visual Studio automatically set the build and revision number. </p>\n\n<p>You can change this to a hard coded value in the format <code>&lt;major version&gt;.&lt;minor version&gt;.&lt;build number&gt;.&lt;revision&gt;</code></p>\n\n<p>You are allowed to use any or all of the precision. For instance 3.5 or 3.5.3167 or 3.5.3167.10000.</p>\n\n<p>You can also use compiler conditions to change the versioning based on whether you\'re doing a debug build or release build.</p>\n'}]
['https://Stackoverflow.com/questions/40779', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3799/']