BMuuN / vsts-assemblyinfo-task

Assembly Info is an extension for Azure DevOps that populates assembly information metadata from a build pipeline.
https://marketplace.visualstudio.com/items?itemName=bleddynrichards.Assembly-Info-Task
MIT License
45 stars 27 forks source link

Handle commented entries in AssemblyInfo #365

Open dbenzhuser opened 8 months ago

dbenzhuser commented 8 months ago

In a project my AssmblyInfo.cs files contained commented version entries like this:

// Version information for the assembly is set in CI.
////[assembly: AssemblyVersion("0.0.0.0")]
////[assembly: AssemblyFileVersion("0.0.0.0")]

But even though the task output showed that the files had been processed successfully, the resulting assemblies still had their version set to 0.0.0.0.

Turns out the task just replaced the values, not recognizing that the entries were disabled:

// Version information for the assembly is set in CI.
////[assembly: AssemblyVersion("1.2.3.4")]
////[assembly: AssemblyFileVersion("1.2.3.0")]`

Small fix on my side of course, but tricky to realize what went wrong.