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

[Code Snippet] Assert Exception in private methods using PrivateObject

Update WPF Interaction Triggers in from .Net Framework 4.8 to .Net 5

[Code snippet] How to set value of private variable in Unit Test Using Reflection ?