Sequence contains no elements

My TeamCity build is erroring on the octo command. I get the following error …

[11:09:40]Step 4/4: Deploy (Command Line) (18s)
[11:09:40][Step 4/4] Starting: F:\BuildAgent\Build2\temp\agentTmp\custom_script1380747475573443451.cmd
[11:09:40][Step 4/4] in directory: F:\BuildAgent\Build2\work\46876f3c74cf72a9
[11:09:41][Step 4/4] Octopus Command Line Tool, version
[11:09:41][Step 4/4]
[11:09:41][Step 4/4] Finding project: Logging
[11:09:41][Step 4/4] Handshaking with Octopus server: http://nausmntfsapp01:9191/api
[11:09:53][Step 4/4] Handshake successful. Octopus version:; API version: 1.0.0
[11:09:54][Step 4/4] Finding environments...
[11:09:55][Step 4/4] Finding steps for project...
[11:09:55][Step 4/4] Getting package versions for each step...
[11:09:59][Step 4/4] Sequence contains no elements
[11:09:59][Step 4/4] System.InvalidOperationException: Sequence contains no elements
[11:09:59][Step 4/4] at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
[11:09:59][Step 4/4] at ProjectExtensions.GetPackageForStep(IOctopusSession session, Step step, String version)
[11:09:59][Step 4/4] at OctopusTools.Commands.CreateReleaseCommand.Execute()
[11:09:59][Step 4/4] at OctopusTools.Infrastructure.CommandProcessor.Process(String[] args)
[11:09:59][Step 4/4] Process exited with code 2
[11:09:59][Step 4/4] Step Deploy (Command Line) failed

The script looks like …

"Libraries\Octo.exe" create-release ^
--server=http://nausmntfsapp01:9191/api ^
--project=Logging --version=%build.number% ^
--packageversion=%build.number% ^
--deployto=Development --force ^

Is this related to the issue of TeamCity feed not yet publishing the newly created nuget package?

~ Paul


Yes, it looks to be related to the package not being published in TeamCity yet. You’ll need to configure a second build configuration in TeamCity that has a dependency on the first, and use that configuration to call octo.exe instead. This way the artefact will be guaranteed to have been published.