Miguel
Miguel

Reputation: 53

Teamcity AssemblyInfo patcher not working

I get the following error message in the TeamCity build log when trying to use the AssemblyInfo Patcher:

[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]

The GlobalAssemblyInfo.cs file is in the same dir as the solution file. Maybe permissions issue?

Using TeamCity Enterprise 9.1.5 (build 37377)

My GlobalAssemblyInfo.cs:

using System;
using System.Reflection;
using System.Runtime.InteropServices;


[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")]

Edit:

Even tried with Assembly version format: 0.0.1.1 hardcoded in TeamCity...

Thanks

Upvotes: 1

Views: 1688

Answers (2)

Stan1k
Stan1k

Reputation: 360

In my case a AssemblyInfo.cs file was missing in the project.
Make sure you have this file with the following attributes:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Upvotes: 0

Alina Mishina
Alina Mishina

Reputation: 3380

There should be the following attributes in the GlobalAssemblyInfo.cs file: AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion. See the documentation for details.

Upvotes: 2

Related Questions