Nicolas Bouchard
Nicolas Bouchard

Reputation: 1

Pushing Nuget package to Azure Feed fail: The package is invalid: The package version is too long. The maximum length is "90" characters

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

Upvotes: 0

Views: 797

Answers (1)

Joy Wang
Joy Wang

Reputation: 42063

Yes, as mentioned in the error message, there is a "90" characters limitation to the package version length.

In your case, if you can make sure the version length does not reach the limitation, you could report the problem in the Azure DevOps Feedback- https://developercommunity.visualstudio.com/report?entry=problem&space=21&preview2=true.

Upvotes: 0

Related Questions