Adding Assembly Versioning to VSTS Build

Adding Assembly Versioning
Application Innovation / Automation - AI, ML, & RPA / Biosciences / Data & Analytics / Digital Optimization Strategy / Healthcare / IT Consulting / Process / Software Development / Software Testing

Adding Assembly Versioning to VSTS Build

Over the past few months, we have been refining and adding functionality to our On-Premises release toolkit. One of our newer requests was the ability to provide versioning to assemblies. This was important because we needed to be able to correlate a bug to a specific build easily. To accomplish this goal we added a new task to our toolkit that sets the version in all of the AssemblyInfo.cs files in your project. Here are the steps to add this to your own project.

    1. Make sure you have added out On-Premise Release toolkit to your instance of VSTS from here
    2. In order to easily correlate builds to Assembly Versions, you will want to change the build number format of your build to $(Year:yy)$(DayOfYear)$(rev:.r) . Unfortunately, C# limits build numbers to be limited to below 65535 which is why we are using the Julian Date.
    3. Add the new ‘Set Assembly Version’ task to your build. You will want this to be the first task to run in your build. Set the version number to something meaningful to you. Setting it to 1.0.$(Build.BuildNumber) will use the build number you set on the general page.

The drop that comes from your build should now be versioned! If you want to show this in your UI, You can add this to your Razor or Asp.Net View.

This task should be available to everyone that has added our extension. Please let us know any of your feedback on our GitHub page or contact us if you are interested in having Technossus Automate your Release Management Process