AssemblyInfo patcher not working
Answered
[Update assembly versions] Updating assembly version in C:\...\work\xxxxxxxxxx\GlobalAssemblyInfo.cs
[10:15:28][Update assembly versions] Assembly file version was specified, but couldn't be patched in file C:\...\work\xxxxxxxxxxxxx\GlobalAssemblyInfo.cs. Is necessary attribute missing?
[10:15:28]
Using TeamCity Enterprise 9.1.5 (build 37377)
My GlobalAssemblyInfo.cs:
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyCompany("xxxxxxx")]
[assembly: AssemblyProduct("xxxxxxx")]
[assembly: AssemblyCopyright("xxxxxxxxxxxxxxxx")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyConfiguration("xxxxx")]
[assembly: AssemblyDescription("xxxxxxx")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyCompany("xxxxxxx")]
[assembly: AssemblyProduct("xxxxxxx")]
[assembly: AssemblyCopyright("xxxxxxxxxxxxxxxx")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyConfiguration("xxxxx")]
[assembly: AssemblyDescription("xxxxxxx")]
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
The GlobalAssemblyInfo.cs file is in the same dir as the solution file. Even tried with Assembly version format: 0.0.1.1 hardcoded in TeamCity....
Please sign in to leave a comment.
Hi,
Any help on this?
Thanks
Hello Miguel,
Sorry for delay.
There should be the following attributes in the GlobalAssemblyInfo.cs file:
AssemblyVersion,AssemblyFileVersionandAssemblyInformationalVersion. See the documentation for details.
If all attributes are present, but feature still does not work, then please attach build log and screenshot of Assembly info patcher feature.
I was missing the AssemblyFileVersion attribute. It's a shame that the build log doesn't say anything about this.
Thanks,
Miguel