Home / file parsed but not updating / Vb net assembly version not updating

Vb net assembly version not updating

What we want from the build script (for now) is basically just to have the common assembly version number changed via a parameter (eventually to be passed in by the build server) and then for the project to build.

Also we’d like to have a flexibility to define what build configuration to use (debug, release, etc).

This is ideally included in some task, which is actually a custom task, because MSBuild does not have regex update capabilities.All of the code from this post can be found at https://github.com/srkirkland/Build Version.The first step is to create a common location for the repeated assembly info that is spread across all of your projects.In order to find/replace the version number, we are going to use a Regular Expression to find and replace the text within your Common Assembly file.There are many other ways to do this using community build task add-ins, but since we want to keep it simple let’s just define the Regular Expression task manually in a new file, Build.tasks (this example taken from the Nu Get build.tasks file).An example Common Assembly is as follows: For each of your projects, you’ll want to clean up your assembly info to contain only information that is unique to that assembly – everything else will go in the Common Assembly file.For most of my projects, that just means setting the Assembly Title, though you may feel Assembly Description is warranted.Common requirement when creating a build for your .NET project is to stamp assemblies with some build version number.There is a File Update task in MSBuild Community Tasks project, which you can use if you want to import it.I don't want to import a whole lot of MSBuild Community Tasks just for this, so I define it quickly inside our Build Common.targets: .


Leave a Reply

Your email address will not be published. Required fields are marked *