When using OctoPack, the NuGet package that was built would default to version 1.0.0. This could be overridden from the MSBuild command line by passing:
/p:OctopusPackageVersion=2.0.0
This works nicely when using a build tool that generates version numbers, since you can usually pass the parameter to MSBuild.
An issue was opened on GitHub some time ago to add support for this:
[assembly: AssemblyVersion("1.0.*")]
I didn’t know of a way to do this without adding a custom task to work it out, but André posted an example using the GetAssemblyIdentity MSBuild task. Thanks to André, OctoPack 1.0.99 will now read the version number from the primary output assembly, if it isn’t overridden by passing /p:OctopusPackageVersion
from the command line.
You can view the diff on GitHub.
Tags:
Related posts

Certificates Feature
Certificates can be uploaded in PFX, PEM, or DER formats, and may include private-keys. They can be scoped to Environments and\or Tenants.

Deploying to no targets
As part of Octopus Deploy 3.8.7 we released a new feature related to Elastic and Transient Environments that we thought warranted a call out.

Octopus Deploy 3.7 - Effortless step templates
The new release of Octopus Deploy steps it up a notch by improving the UI for adding a step template, providing direct access to community step templates from a project's deployment process and improving the management of step templates in the library.