You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

构建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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:00:55