1
votes

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.

1

1 Answers

2
votes

With nuget.exe push, we added a -SkipDuplicates option in v5.1 and higher: https://docs.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://docs.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://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/nuget?view=azure-devops&tabs=yaml#publish-your-packages