【发布时间】:2022-12-30 18:08:17
【问题描述】:
从 dotnet 5 迁移到 dotnet 6 后,构建管道在 Dotnet nuget push 上失败并出现以下错误。我们正在使用 Azure Devops Server 2020.1。这是否支持最新的 dotnet 6 或我是否需要升级到最新版本。
##[section]Starting: dotnet nuget push
==============================================================================
Task : .NET Core
Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version : 2.174.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
[command]C:\windows\system32\chcp.com 65001
Active code page: 65001
SYSTEMVSSCONNECTION exists true
##[warning]Could not create provenance session: %s
##[warning]Failed to read storage account information : Failed to retrieve settings required for storage account information from strongbox. Both StorageAccountKeyBaseName and StorageAccountCount are needed.
[command]"C:\Program Files\dotnet\dotnet.exe" nuget push c:\agents\w1\68\a\abc.efg.MaxData.Models.3.7.0.nupkg --source https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v3/index.json --api-key VSTS
Pushing abc.xyz.Models.2.5.0.nupkg to 'https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/'...
PUT https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/
InternalServerError https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/ 43ms
PUT https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/
InternalServerError https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/ 33ms
PUT https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/
InternalServerError https://tfs.abc.com/tfs/Primary/_packaging/21870199-3f81-4121-b786-82b7e2d3d1dc/nuget/v2/ 43ms
error: Response status code does not indicate success: 500 (Internal Server Error).
Usage: dotnet nuget push [arguments] [options]
Arguments:
[root] Specify the path to the package and your API key to push the package to the server.
Options:
-h|--help Show help information
--force-english-output Forces the application to run using an invariant, English-based culture.
-s|--source <source> Package source (URL, UNC/folder path or package source name) to use. Defaults to DefaultPushSource if specified in NuGet.Config.
-ss|--symbol-source <source> Symbol server URL to use.
-t|--timeout <timeout> Timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).
-k|--api-key <apiKey> The API key for the server.
-sk|--symbol-api-key <apiKey> The API key for the symbol server.
-d|--disable-buffering Disable buffering when pushing to an HTTP(S) server to decrease memory usage.
-n|--no-symbols If a symbols package exists, it will not be pushed to a symbols server.
--no-service-endpoint Does not append "api/v2/package" to the source URL.
--interactive Allow the command to block and require manual action for operations like authentication.
--skip-duplicate If a package and version already exists, skip it and continue with the next package in the push, if any.
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[error]Packages failed to publish
Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions.
Some commonly encountered changes are:
If you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[section]Finishing: dotnet nuget push
下面是位于构建代理机器上的 %Appdata%/Roaming\NuGet\nuget.config 的 nuget 配置文件
我也使用 PAT 凭据但没有用,得到同样的错误。请有人帮我解决这个问题。我在这里呆了很长时间。
【问题讨论】:
-
这是标准的 Nuget 推送失败,请检查您的 nuget 配置。升级后,它可能未正确定义。
-
在这样的问题中,明智的做法是包含一些关于您已经尝试解决问题的步骤的信息。如果错误信息包括建设性的反馈,就像这个,那么我们希望您已经阅读了该信息并尝试遵循给出的建议。请更新帖子以包括您已采取的步骤或您在理解错误响应时遇到的麻烦。
-
@ChrisSchaller 我刚刚添加了任务的图像。请你检查一次。也请帮助我在哪里检查配置。
-
您的屏幕截图不会显示目标 Feed 是此帐户还是外部帐户。这对于这个问题很重要,特别是如果您的提要是外部的。
-
@ChrisSchaller 感谢您回复我。我的目标 Feed 位置是 This organization/collection。
标签: azure azure-devops tfs nuget azure-pipelines