TeamCity 9.0 Help

AssemblyInfo Patcher

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.

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.

Last modified: 20 April 2023