I have a build pipeline which uses the Nuget Task to push Nuget packages to an Azure Feed. These packages have been previously versioned using GitVersion and the filename is similar to "Permission.BusinessEntities.1.1.0-azure-pipelines.3279.nupkg" which is a total of 60 characters including extension.
For whatever reason, when pushing these packages to the feed I get this error:
Adding package to feed. POST (https://pkgs.dev.azure.com/x/_apis/packaging/x/nuget/packages) failed. ActivityId: x, HTTP Status: BadRequest, AFD Ref: Ref A: x Ref B: x Ref C: 2021-09-10T15:45:20Z ##[error]Error: An unexpected error occurred while trying to push the package with VstsNuGetPush.exe. Exit code(1) and error(Error: Microsoft.VisualStudio.Services.NuGet.WebApi.Exceptions.InvalidPackageException: The package is invalid: The package version is too long. The maximum length is 90 characters.
I can push these packages on the same feed using the Nuget command line locally.
Nuget task: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/package/nuget?view=azure-devops
I've tried to shorten the package name and the pre-release tag without success. I'm suspecting the error message is misleading.
Please help