【发布时间】:2019-02-19 23:31:22
【问题描述】:
我正在尝试使用 dotnet core CLI 和以下命令安装 xunit NuGet 包:
dotnet add package xunit -s https://api.nuget.org/v3/index.json
从类库文件夹中。但是,我在执行该行时看到了这一点:
Writing C:\Users\<myuser>\AppData\Local\Temp\tmp7238.tmp
info : Adding PackageReference for package 'xunit' into project 'C:\git\Testing\TestLib\TestLib.csproj'.
log : Restoring packages for C:\git\Testing\TestLib\TestLib.csproj...
info : CACHE https://api.nuget.org/v3-flatcontainer/xunit/index.json
error: Unable to load the service index for source https://<mysourcecontrol>.pkgs.visualstudio.com/_packaging/libs/nuget/v3/index.json.
error: Response status code does not indicate success: 401 (Unauthorized).
AFAIK 这告诉我,我机器上的 nuget 实用程序无法找到有关我们本地 NuGet 源的相关信息。我不明白为什么这甚至是一个问题 - 我正在指定要使用的源(这是常规的 nuget.org 路径)。
【问题讨论】: