Search code examples
azure-pipelinesnuget-serverazure-pipelines-build-task

VSTS internal package server with – version-suffix doesn't really push to server, some other questions


Question 1: I'm using VSTS internal nuget server, I have some problem while playing with it.

Now I have a build definition publishing to VSTS internal package server as below, where I set --version-suffix as build number

enter image description here

After build and publish package per VSTS build, the new packages with suffix should all have been successfully pushed to the server - at least from the log,enter image description here

Yet don’t know why, none of them were reflected correctly in the package list, only Common.Test which I removed before the build,enter image description here

Question 2: How in the setting I can ignore *.test.csproj for “dotnet pack”?

Question 3: We’re using internal package server, now the interesting thing is, I cannot find a way with “dotnet restore” to get from any nuget config, or internal nuget feed, when this supports internal nuget server/nuget.config as “nuget restore”?

enter image description here


Solution

  • The reason why interal package server don’t show the nuget package with version suffix is that the nuget version 1.0.0 already exist before you pack .nupkg files with --version-suffix v$(build.buildnumber) argument and nuget treat 1.0.0 version is newer than 1.0.0-v$(build.buildnumber) . You can find your pushed versions by click dropdown list. enter image description here

    If you want to ignore some .csproj to generate .nupkg, you can set in dotnet pack. You can ignore *Test.csproj in dotnet pack with two line as below picture:

    enter image description here