Nuget version resolution bug?

I had a situation where the SemVer number of my nuget package for octopack went from 1.6.x back to 1.0.x. Even though my TeamCity build supplied Octopus with a 1.0.x package, Octopus disregarded this version and resolved using the ‘latest’ version it could find in the repo i.e. 1.6.x. Is this a bug? See log below:

[22:32:37][Octopus Deploy] Running command:   octo.exe create-release --server="http://deploy1" --apikey=SECRET --project="My Project" --enableservicemessages **--version=""** --deployto="dev" --waitfordeployment 
[22:32:37][Octopus Deploy] Creating Octopus Deploy release
[22:32:37][Octopus Deploy] Octopus Command Line Tool, version
[22:32:37][Octopus Deploy] 
[22:32:37][Octopus Deploy] Finding project: My Project
[22:32:37][Octopus Deploy] Handshaking with Octopus server: http://deploy1/api
[22:32:37][Octopus Deploy] Handshake successful. Octopus version:; API version: 2.0.0
[22:32:37][Octopus Deploy] Finding environments...
[22:32:37][Octopus Deploy] Finding steps for project...
[22:32:37][Octopus Deploy] Resolving NuGet package versions...
[22:32:37][Octopus Deploy]   - Finding latest NuGet package for step: Deploy Website
[22:32:37][Octopus Deploy] Release plan for release:
[22:32:37][Octopus Deploy] Steps: 
[22:32:37][Octopus Deploy]   #   Name             Version         Source                              
[22:32:37][Octopus Deploy]   --- ---------------- --------------- ------------------------------------
[22:32:37][Octopus Deploy]   1   Deploy Website   **1.6.42**          Latest available in NuGet repository
[22:32:37][Octopus Deploy] 
[22:32:37][Octopus Deploy] Creating release...


basically, Octopus has used the "Latest available in NuGet repository ", but I didn’t want it to do that, I provided the version I wanted it to resolve.


You need to specify --package= in addition to --version.

--version tells us the number to use for the release in Octopus, while --package is for the NuGet package version. Note that when using the TeamCity plugin, you pass --package in the “Additional command-line arguments” setting.


great, many thanks Paul.
I ended up using --packageversion as per a previous post of yours I found

(just FYI for anyone else who comes across this in the future)