问题
The AssemblyInfoPatcher build feature isn't working. Some files are patched and some are not.
Assembly file version was specified, but couldn't be patched in file D:\TeamCity\Agent\buildAgent\work\6afd998e316c631f\La\Di\Da\Properties\AssemblyInfo.cs. Is necessary attribute missing?
I thought it was because it was 1.0.*
since one of the failed files had this format, and one of the successful ones had the default 1.0.0.0
format, so I changed the attribute to 1.0.0.0
across the entire solution and now none of them work.
I get either the error above or:
Assembly version attributes were not found in ...
The attribute is defined and at least two other people on the team have confirmed that they can also see it using their production eyes.
Happy to stump up the cash so I can smash my work keyboard.
回答1:
Well, I managed to get it working but not.
I had a Configuration Parameter called AssemblyVersionStringWithCounter
that I set from a PowerShell script. I was using this in the patcher feature.
I changed it to be composed of other parameters like
%MajorVersionNumber%.%MinorVersionNumber%.%BuildWeek%.%build.counter%
And now it mods the files but the params are not set, the version is incorrect. Seems the AssemblyInfoPatcher cannot use values set during the build steps.
Seems I've wasted about £800 of my client's money when I should have just PowerShelled it from the start. Code is King.
来源:https://stackoverflow.com/questions/33938529/teamcity-assemblyinfopatcher-not-working-error-is-logged