Search code examples
c#buildversionversioning.net-assembly

Is it possible to switch build and revision number in .NET to [Major].[Minor].[Patch].[Build]


We have an ASP.NET WebForms application with standard versioning numbering in this format:

[Major].[Minor].[Build].[Revision]

Every build increases the build number, e.g.,

2.2.1.0 => 2.2.2.0

External monitoring tooling works with the following format:

[Major].[Minor].[Patch].[Build]

This way builds should increase the version number as follows:

2.2.1.0 => 2.2.1.1

We want to send information of the version number from different systems. Right now we just use a regex to change the order as follows:

From {1}{2}{3}{4} to {1}{2}{4}{3} (switch revision/patch and build).

My idea was to just change the version number in our SolutionInfo.cs file to the new format so that a new BUILD increases the last number. That way all other tools later in the pipeline can send messages to the monitoring tool in the right format.

Is it possible to just change the order of the version number? Does this have any unwanted effects?


Solution

  • According to the responses in another question it is possible with Build Version Increment add-In with this workaround for VS2013.