如何在从 DevOps 提取的解决方案中使用 DevOps nuget 包

How to use DevOps nuget package in solution pulled from DevOps

我在 DevOps 中使用 ssh 密钥进行了验证(至少 git)

所以我从 mycompany@vs-ssh.visualstudio.com:v3/mycompany/thing/thing 中提取了一个解决方案,并尝试使用 dotnet build 构建它,但出现错误

/usr/local/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/SomeProject/nuget/v3/index.json. /usr/local/share/dotnet/sdk/3.1.402/NuGet.targets(128,5): error : Response status code does not indicate success: 401 (Unauthorized).

如何解决这个问题(我假设通过对源服务器进行身份验证)并构建项目?

请安装 Azure Artifacts Credential Provider,安装完成后 运行 dotnet restore --interactive 然后系统会提示您登录如下页面: