VSTS issue with applying Build Version Number to the assemblies

Viewed 2623

I have an issue with applying Build Version to my assemblies in the VSTS Pipeline.

In the past this was achieved was using MSBuild Targets.

My AssemblyInfo.cs class in the projects within the solution have the following setup:

[assembly: AssemblyTitle("Demo App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("Release x86")]
[assembly: AssemblyCompany("Demo App Ltd")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("© 2018. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]

Here is my build pipeline request: enter image description here

In my build pipeline i build the solution first and then when that succeeds it calls one of the Manifest Versioning Build Tasks called VersionAssemblies to update .NET Assemblies. But its not updating the Product Version and File Version after the solution has been built by the server.

Here is my current setup regarding this task that is in my pipeline

enter image description here

I'm not sure what i'm doing wrong because when i examined the assembly files that have been built it only contains the default version i.e 1.0.1.0.

  1. So what am i doing wrong?
  2. Can someone advise what i can try next please?

UPDATE

It works if i move the Task before i build the solution. I suspect this is the correct way but can someone confirm please?

1 Answers

Issue can be resolved by doing the following: Put the "Version.NET task" before building the solution task. It patches the sources in-place, not the binaries.

Related