Getting Package Version for Azure DevOps

I’m trying to configure the “Push Package Build Information to Octopus” task in Azure DevOps but am not sure how to populate the “Package Version” field when the version is autogenerated by using a wildcard in the assemblyVersion of a .net project. Seems like a common setup so I am hoping that I am missing something simple. Any help is appreciated.

Most of our projects are still running octopack switch when building the solution.

Hi @brainerdj,
In my experience, people will generally have their build server be the source of truth for the build number/versioning. This also allows you to pass around the version number to different systems and/or notifications, etc more readily.

You may want to look into having your build server handle the versioning for you. For Azure DevOps you can do this under you pipeline Options > Build number format (or something like that). I think this bit of documentation might help: Run (build) number - Azure Pipelines | Microsoft Docs.

With your current process you would need to read the value from the Assembly Info and then set a variable to that value which you could then pass into the steps which need it. It looks like there might be some existing extensions which would allow this such as: Assembly Info Reader - Visual Studio Marketplace which would expose a variable you can use $(AssemblyInfo.AssemblyVersion).

I hope this helps!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.