vsts-assemblyinfo-task
vsts-assemblyinfo-task copied to clipboard
AssemblyVersion Not Using `#` for Individual AssemblyInfo.cs Files
While I may consider this a bug, it's probably by design. However, it does not satisfy my requirements.
I use #.#.#.*
as my AssemblyVersion. In essence, I just want to put an incremental build number at the end of all my versions. However, I do NOT want to modify the rest of the AssemblyVersion.
It appears that this task grabs the first AssemblyVersion after applying the #.#.#.*
, and then uses that for all other assembly infos. The problem is, I have 8+ products, and they all have different AssemblyVersions (I want to unify them via the AssemblyFileVersion, though.)
I realize this will affect the output variables, but do you know of any way we can do what I'm requesting?
2023-05-16T15:51:13.2282231Z ##[section]Starting: Set Assembly Manifest Data
2023-05-16T15:51:13.2409414Z ==============================================================================
2023-05-16T15:51:13.2409539Z Task : Assembly Info (.Net Framework)
2023-05-16T15:51:13.2409639Z Description : Set assembly information such as Version, Copyright and Trademark etc.
2023-05-16T15:51:13.2409742Z Version : 3.2.3
2023-05-16T15:51:13.2409800Z Author : Bleddyn Richards
2023-05-16T15:51:13.2409881Z Help : [More Information](https://marketplace.visualstudio.com/items?itemName=bleddynrichards.Assembly-Info-Task)
2023-05-16T15:51:13.2410006Z ==============================================================================
2023-05-16T15:51:14.4325245Z ##[group]Task Parameters...
2023-05-16T15:51:14.4326610Z Source folder: D:\a\40\s
2023-05-16T15:51:14.4328217Z Source files: **\AssemblyInfo.cs,**\AssemblyInfo.vb
2023-05-16T15:51:14.4328942Z Insert attributes: true
2023-05-16T15:51:14.4329929Z File encoding: auto
2023-05-16T15:51:14.4330606Z Write unicode BOM: false
2023-05-16T15:51:14.4331683Z Title:
2023-05-16T15:51:14.4332508Z Product: MyCompany MyProduct
2023-05-16T15:51:14.4333135Z Description:
2023-05-16T15:51:14.4333717Z Company: MyCompany
2023-05-16T15:51:14.4334782Z Copyright: Copyright © MyCompany 2023
2023-05-16T15:51:14.4335413Z Trademark:
2023-05-16T15:51:14.4335940Z Culture:
2023-05-16T15:51:14.4336535Z Configuration: release
2023-05-16T15:51:14.4337209Z Assembly version: #.#.#.8536
2023-05-16T15:51:14.4337783Z Assembly file version: 4.8.0.0
2023-05-16T15:51:14.4338340Z Informational version:
2023-05-16T15:51:14.4338917Z Log Level: verbose
2023-05-16T15:51:14.4339506Z Fail on Warning: false
2023-05-16T15:51:14.4340101Z Build Tag:
2023-05-16T15:51:14.4340687Z Build Number:
2023-05-16T15:51:14.4341284Z ##[endgroup]
2023-05-16T15:51:14.4341955Z Setting .Net Framework assembly info...
2023-05-16T15:51:15.6495667Z ##[group]Processing: D:\a\40\s\CS Analytics Tool\MyCompany.MyProduct.CS.Analytics.Common\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6574210Z Detected file encoding: utf-8
2023-05-16T15:51:15.6706447Z AssemblyVersion --> #.#.#.8536
2023-05-16T15:51:15.6709889Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6712383Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6714309Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6716547Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6718692Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6752352Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6753877Z ##[endgroup]
2023-05-16T15:51:15.6754894Z ##[group]Processing: D:\a\40\s\CS Analytics Tool\MyCompany.MyProduct.CS.Analytics\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6777761Z Detected file encoding: utf-8
2023-05-16T15:51:15.6781323Z AssemblyVersion --> 1.3.5.8536 **(NO, please don't do this. It should be 3.5.2.8536.)**
2023-05-16T15:51:15.6781780Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6782884Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6783608Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6784068Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6784516Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6790941Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6792002Z ##[endgroup]
2023-05-16T15:51:15.6792399Z ##[group]Processing: D:\a\40\s\CS Migration Tool to Network\MyCompany.MyProduct.CS.Exporter.Network.Common\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6799826Z Detected file encoding: utf-8
2023-05-16T15:51:15.6802153Z AssemblyVersion --> 1.3.5.8536
2023-05-16T15:51:15.6802544Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6802817Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6803023Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6803217Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6803622Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6813567Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6814028Z ##[endgroup]
2023-05-16T15:51:15.6814259Z ##[group]Processing: D:\a\40\s\CS Migration Tool to Network\MyCompany.MyProduct.CS.Exporter.Network\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6823390Z Detected file encoding: utf-8
2023-05-16T15:51:15.6827594Z AssemblyVersion --> 1.3.5.8536
2023-05-16T15:51:15.6828659Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6829102Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6830035Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6830403Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6830656Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6841692Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6842371Z ##[endgroup]
2023-05-16T15:51:15.6842636Z ##[group]Processing: D:\a\40\s\CS Migration Tool to SharePoint\MyCompany.MyProduct.CS.Exporter.SharePoint.Common\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6849366Z Detected file encoding: utf-8
2023-05-16T15:51:15.6851614Z AssemblyVersion --> 1.3.5.8536
2023-05-16T15:51:15.6851908Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6853182Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6853768Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6854874Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6855300Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6859877Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6861358Z ##[endgroup]
2023-05-16T15:51:15.6861836Z ##[group]Processing: D:\a\40\s\CS Migration Tool to SharePoint\MyCompany.MyProduct.CS.Exporter.SharePoint\Properties\AssemblyInfo.cs
2023-05-16T15:51:15.6864887Z Detected file encoding: utf-8
2023-05-16T15:51:15.6867189Z AssemblyVersion --> 1.3.5.8536
2023-05-16T15:51:15.6867951Z AssemblyFileVersion --> 4.8.0.0
2023-05-16T15:51:15.6868796Z AssemblyProduct --> MyCompany MyProduct
2023-05-16T15:51:15.6869559Z AssemblyCompany --> MyCompany
2023-05-16T15:51:15.6869960Z AssemblyConfiguration --> release
2023-05-16T15:51:15.6870621Z AssemblyCopyright --> Copyright © MyCompany 2023
2023-05-16T15:51:15.6874975Z Verify file encoding: iso-8859-1
2023-05-16T15:51:15.6875885Z ##[endgroup]
2023-05-16T15:51:15.6919012Z ##[group]Setting output variables...
2023-05-16T15:51:15.6934220Z $.AssemblyInfo.Version: 1.3.5.8536
2023-05-16T15:51:15.6935798Z $.AssemblyInfo.FileVersion: 4.8.0.0
2023-05-16T15:51:15.6936872Z $.AssemblyInfo.InformationalVersion:
2023-05-16T15:51:15.6937199Z ##[endgroup]
2023-05-16T15:51:15.6937534Z ##[group]Updating build...
2023-05-16T15:51:15.6937845Z ##[endgroup]
2023-05-16T15:51:15.7376803Z ##[section]Finishing: Set Assembly Manifest Data
Hey @DaleyKD thanks for the detailed post it is a great help when trying to diagnose issues.
This is indeed by design. The idea is we have the same input values set in the assembly data for all Source files
. The wildcard option (#.#.#.*)
will return the entire version number of the first file it processes and that version number is set in the remaining source files and output variables.
The only solution I can offer you is to either:-
Leave the Assembly version
task parameter empty and set the version number via code for each project e.g. [assembly: AssemblyVersion("3.5.2.*")]
. This will enable you to keep the existing version number and set a random revision number. You can then set a common Assembly file version
via the task.
or; standardise your version number and use the same version number for all your assemblies (how it's currently working)
or; Add multiple tasks which target different source files, this will enable you to keep the existing version number and set a standard file version number however, please be aware the task which runs last will end up setting the output variables.
I appreciate this wasn't the answer you were looking for but I hope this helps you come to a decision on how to resolve the issue you are facing.