Setting up automatic product or build version increment using JENKINS for .NET projects

Steps for setting up automatic product or build version increment using JENKINS Continious Integration server and Visual Studio for .NET projects

Part A - Configure Visual Studio Solution

1. Copy the "AssemblyInfo.cs" from your project solutions and rename into "AssemblyInfo.cs.template"



2. Add a file called "AssemblyInfo.cs.template" and replace with these two lines:
             [assembly: AssemblyVersion("#VERSION_NUMBER#")]
             [assembly: AssemblyFileVersion("#VERSION_NUMBER#")]

3. In project properties, insert this pre-build command:
     "$(SolutionDir)builder-scripts\templates\pre-build\Stamper.exe" "$(ProjectDir)\"



4. Put the "builder-scripts" folder into your solution folder. Builder scripts source


Part B - Configure Jenkins Continuous Integration Server

5. Configure Jenkins builds and insert following in build shell

                 .\builder-scripts\templates\pre-build\Stamper.exe .



6. Set Jenkins build number and build the project


7. Right-click recently build EXE , Properties ==> Details (you will see updated production/build version) 






Comments

Popular posts from this blog

Prevent WPF Global Keyboard Hook from stops working after hitting keys a while C# .NET

Generate ArcGIS Token By URL Request From ArcGIS Portal, Federated Environment , ESRI JS API and Angular snippets

Solution: IntelliJ not recognizing a particular file correctly, instead its stuck as a text file