[VS Code] dotnet add package XXX 失败 (Response status code does not indicate success: 407 (authenticationrequired))

记录下今天遇到的错误及找到的解决方案。

 

 

1.找到Nuget配置文件 c:\users\{username}\AppData\Roaming\Nuget\NuGet.Config.

2.配置http_proxy.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
    <config>
    <add key="http_proxy" value="http://Proxy:Port" />
  </config>
</configuration>

 

posted @ 2022-11-23 16:44  WikiChen  阅读(160)  评论(0编辑  收藏  举报