Icon

You are viewing the documentation of TeamCity 9.x, which is not the most recently released version of TeamCity.
View this page in TeamCity 10.x and 2017.1 documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 
Skip to end of metadata
Go to start of metadata

The AssemblyInfo Patcher build feature allows setting a build number to an assembly automatically, without having to patch the AssemblyInfo.cs files manually. When adding this build feature, you only need to specify the version format. Note that you can use TeamCity parameter references here.

Icon

 AssemblyInfo Patcher should be used with the automatic checkout only: after this build feature is configured, it will run before the first build step. TeamCity will first perform replacement in the files found in the build checkout directory and then run your build. 

TeamCity searches for all AssemblyInfo (including GlobalAssemblyInfo) files: .cs, .cpp, .fs, .vb in their standard locations under the checkout directory and replaces the parameter for the AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion attributes with the build number you have specified in the TeamCity web UI.

At the end of the build the files are reverted to the initial state.

Note that this feature will work only for standard projects, i.e. created by means of the Visual Studio wizard, so that all the AssemblyInfo files and content have a standard location.

Icon

For replacing a wider range of values in a larger number of files, consider using the File Content Replacer build feature.

 

 

  • No labels