8

I am changing my Azure DevOps build to .NET Core.

It's all working except the final push step to get the package in my feed, I get this error:

Response status code does not indicate success: 409 (Conflict - The feed already contains 'mypackage 1.0.x' (Devops Activity ID: xxx))

In the old "Nuget Push" step there was an option to "Allow duplicates to be skipped", specifically to get around this problem - but this option is not available in the "dotnet push" step.

How can this be achieved in the dotnet core world?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
TomFp
  • 469
  • 1
  • 5
  • 13

2 Answers2

4

This can be accomplished by dividing the process into Build and Release, because the the job in the release pipeline support skipping upload if a package with the same name and version already exists.

Build pipeline

Add a build with the following steps enter image description here Publish the compiled nupkg file as output of the build.

enter image description here

Release pipeline

Create a release pipeline connected to the build pipeline. Click Alow duplicated to be skipped. enter image description here

Mathias Rönnlund
  • 4,078
  • 7
  • 43
  • 96
  • That option is not available for external feeds, such as nuget.org – Toby Sep 19 '19 at 12:22
  • That seems to be correct that you cannot "allow duplicates to be skipped" when using an external feed. – Mathias Rönnlund Sep 20 '19 at 09:48
  • That option to allow duplicates to be skipped is there on build as well as release pipelines; I don't see how doing the same thing in a release pipeline would change anything. – Zimano Oct 06 '22 at 14:39
  • I just use the `NuGet push` task shown in this answer, in lieu of the `dotnet push` task - and I get the results I'm wanting (not using a release pipeline... everything is just in the CI pipeline) - [more details on my answer here](https://stackoverflow.com/a/74240063/1520850) – bkwdesign Oct 28 '22 at 19:30
0

If you are fine with "partially successful" status - just check "Continue on error" in Control options for the task.

If not - check here: You have to check version of the package before pushing

Valeev
  • 26
  • 3