Search code examples
azure-artifacts

VSTS CI NuGet push to private feed success but doesn't show anything


I have a solution building as part of continuous integration, with a step to push a class library out to my VSTS package feed. This worked the first time the CI build ran and created the package. The second time it shows it was successful, but a new version doesn't exist or any sign of a new package.

Prior to the second build, I promoted the package to @release, if that makes a difference?

Output of the CI build for NuGet push is below:

2017-07-24T10:48:51.4888942Z ##[section]Starting: NuGet push 2017-07-24T10:48:51.4888942Z ============================================================================== 2017-07-24T10:48:51.4888942Z Task : NuGet 2017-07-24T10:48:51.4888942Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. 2017-07-24T10:48:51.4888942Z Version : 2.0.5 2017-07-24T10:48:51.4888942Z Author : Microsoft Corporation 2017-07-24T10:48:51.4888942Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) 2017-07-24T10:48:51.4888942Z ============================================================================== 2017-07-24T10:48:51.9019022Z [command]C:\Windows\system32\chcp.com 65001 2017-07-24T10:48:51.9059034Z Active code page: 65001 2017-07-24T10:48:51.9219032Z SYSTEMVSSCONNECTION exists true 2017-07-24T10:48:51.9409032Z Detected NuGet version 4.0.0.2283 / 4.0.0 2017-07-24T10:48:52.1389068Z Saving NuGet.config to a temporary config file. 2017-07-24T10:48:52.1449080Z ##[warning]No package sources were found in the NuGet.config file at d:\a\1\Nuget\tempNuGet_150.config 2017-07-24T10:48:52.1549071Z [command]d:\a\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.0.5\VstsNuGetPush\0.13.0\VstsNuGetPush.exe d:\a\1\a\WAGR2.DAL.1.0.0-CI-20170724-104834.nupkg -Source https://forgan.pkgs.visualstudio.com/_packaging/1b92b113-5d65-4b30-8749-9362924199b5/nuget/v3/index.json -AccessToken ******** -NonInteractive -Verbosity Detailed 2017-07-24T10:48:52.7149186Z Trying to authenticate with auth token. 2017-07-24T10:48:53.3099300Z Successfully authenticated. 2017-07-24T10:48:53.3189305Z Authentication and request took 00:00:01.0127956 2017-07-24T10:48:53.3589311Z Adding package WAGR2.DAL.1.0.0-CI-20170724-104834.nupkg to feed 1b92b113-5d65-4b30-8749-9362924199b5 on https://forgan.pkgs.visualstudio.com/. 2017-07-24T10:48:53.3589311Z Trying to add package to feed without uploading. 2017-07-24T10:48:53.3589311Z Adding package to feed. 2017-07-24T10:48:54.1399458Z The package content is not already on the service. 2017-07-24T10:48:54.1399458Z Uploading package content. 2017-07-24T10:48:56.0287785Z Done uploading package content. 2017-07-24T10:48:56.0287785Z Adding package to feed. 2017-07-24T10:48:57.3686297Z Successfully added package to feed. 2017-07-24T10:48:57.4256306Z ##[section]Finishing: NuGet push

UPDATE

The Nuget Pack option was to use automatic package versioning based on date & time.

The package doesn't appear in the NuGet gallery along side the others, which is also odd.


Solution

  • I don't know why this was happening, but what now works is:

    • Remove package from feed
    • Change the Nuget Pack Automatic package versioning from date & time to build number, using the Build Number Format (under Options): '$(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)'
    • On NuGet Push, I also had to check the box Allow duplicates to be skipped

    Packages now publish every time and also appear in the NuGet gallery.