构建Visual Studio解决方案遇NuGet 401未授权错误,求其他方案
NuGet包源401未授权问题求助
近几日在Visual Studio中运行公司开发的解决方案,正常构建即可运行,但目前出现以下错误:
Retrying 'FindPackageByIdAsync' for source 'https://nuget.pkg.github.com/CompanyRepo/index.json' Response status code does not indicate success: 401 (Unauthorized)
执行dotnet restore时出现:
Unable to load the service index for source 'https://nuget.pkg.github.com/CompanyRepo/index.json' Response status code does not indicate success: 401 (Unauthorized)
已尝试以下方案但均未解决:
- 确认其他NuGet包及公司其他NuGet包均可正常使用,排除代理问题;
- 删除
%AppData%\Roaming\NuGet\NuGet.Config并重启Visual Studio; - 在
%AppData%\Roaming\NuGet\NuGet.Config中添加指定包源; - 生成启用SSO的Personal Access Token并配置到NuGet包源凭据;
- 执行
dotnet restore --interactive未出现配对URL; - 因本地无TLS 1.3,无需禁用该协议;
- 删除NuGet.Config中指定配置段;
- 确认Visual Studio允许NuGet下载缺失包;
- 检查其他NuGet配置文件;
- 删除凭据管理器中git相关条目并重新验证,仍无效。
寻求可解决该问题的其他方案,望得到帮助。
内容的提问来源于stack exchange,提问作者Mitchell Mastromonaco
相关产品推荐
相关产品推荐

