Versioning is very important in programming development. So that

  1. Users are always downloading the latest version.
  2. Testers are always downloading the right version from the pipeline after the developer fixes the bug.

Recently, the concept of CI/CD (Continuous Integration/Continuous Development) programming practice means that versioning has become even more important. Therefore, practice of coming out with a unique version numbering in application builds becomes crucial.

The build number is generated from the source code so this becomes extra maintenance work for the developer after pushing the code every time. Luckily, with assistance from IDE such as Visual Studio, build can auto generate a new number every time the source code is compiled. There are two ways this can be done.

Approach 1

With the help of an IDE tool (Visual Studio), it can generate a unique version number for every new compilation. Usually, the fourth digit in the version number is reserved for the IDE to auto increase it every time the software is built. Below are the steps on how to set up the process:

  1. Create a file named AssemblyInfo.cs
  2. Define both the file and assembly version in AssemblyInfo.cs
  3. Set “deterministic” property to be false in *.csproj.
  4. Build the project in Visual Studio.
  5. Done.

In AssemblyInfo.cs, we removed the last line and only remains as below.

// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below: [assembly: AssemblyVersion("0.1.2.*")]

#versioning #gitlab #github #git

Using Git Hash for Software Versioning
1.15 GEEK