Reputation: 312
I have a single repo that contains multiple DLLs which create separate NuGet packages. I would like to use the Azure DevOps pipeline to publish these packages automatically when the master branch changes via the NuGet pack and push tasks. I do not want to change the assembly version of the Dlls/NuGet packages that do not change. Running my pipeline causes an exception because of the duplicate versions.
After reading Microsoft's documentation page, I tried adding publishPackageMetadata=true but the build still fails.
Upvotes: 3
Views: 3647
Reputation: 15091
With nuget.exe push
, we added a -SkipDuplicates
option in v5.1 and higher: https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-push#options
It's also available with dotnet nuget push --skip-duplicate
in the .NET Core 3.1 SDK and higher: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
Taking a 30 second look at the Azure DevOps docs, it looks like they have a "allowPackageConflicts" option: https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/nuget?view=azure-devops&tabs=yaml#publish-your-packages
Upvotes: 2