推送到Visual Studio Team Services NuGet feed提供400 BadRequest

Luk*_*ett 1 nuget azure-devops

我在Team Services上有一个私有的NuGet提要,以前是Visual Studio Team Services.如果发出身份验证问题但重置了我的Team Services备用凭据,则清除我的全局配置中的内容并用于nuget sources add将凭据添加回凭据.

所以我认为现在这不是一个身份验证问题.错误已更改.

我的命令行:

NuGet.exe push BrandPortaCoreDistrib.1.2.4.0.nupkg -Source https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/Libraries/nuget/v3/index.json -Verbosity detailed
Run Code Online (Sandbox Code Playgroud)

但我在屏幕上看到了这个:

WARNING: No API Key was provided and no API Key could be found for 'https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/'. To save an API Key for a source use the 'setApiKey' command.
Pushing BrandPortaCoreDistrib.1.2.4.0.nupkg to 'https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/'...
  PUT https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/
  Unauthorized https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/ 1043ms
Using credentials from config. UserName: something@domain.com
  PUT https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/
  BadRequest https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/14e755d8-0994-4b9d-b607-a79928cc4597/nuget/v2/ 5054ms
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__16.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
---> (Inner Exception #0) System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__16.MoveNext()<---
Run Code Online (Sandbox Code Playgroud)

关键是BadRequest在所有这些中间.没有其他状态信息,没有给出帮助的错误.

包版本已不在Feed中.

我以前推到使用此nuspec这个项目这个饲料和我建所以我不知道为什么当今世界恨我的nupkgs.

我正在使用NuGet.exe 3.4.3.855,我是Team Services中的feed的所有者.

奇怪的是,在屏幕上出现的垃圾是如何在其中讨论带有v2的URL,但我的团队服务提要是v3.

Edd*_*SFT 6

在命令中添加"-ApiKey VSTS":

NuGet.exe push BrandPortaCoreDistrib.1.2.4.0.nupkg -Source https://brand.pkgs.visualstudio.com/DefaultCollection/_packaging/Libraries/nuget/v3/index.json -Verbosity detailed -ApiKey VSTS
Run Code Online (Sandbox Code Playgroud)