当前位置: 首页 > article >正文

[C#]无法获取源 https://api.nuge t.org/v3-index存储签名信息解决方法

参考网上大部分方法错误,根本不起作用。正确方法是

C:\Users\你的用户名\AppData\Roaming\NuGet找到NuGet.Config打开,看到类似下面信息(可能不一样)

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
  <packageSources>
    <add key="nuget-ch" value="https://nuget.cdn.azure.cn/v3/index.json" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
  </packageSources>
  <activePackageSource>
    <add key="nuget-ch" value="https://nuget.cdn.azure.cn/v3/index.json" />
  </activePackageSource>
</configuration>

找到关键词 https://api.nuget.org/v3/index.json

在关键词上下行加<disabledPackageSources>包裹起来,没有的话就把下面3行放对应位置

    <disabledPackageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    </disabledPackageSources>

最后

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <disabledPackageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    </disabledPackageSources>
    <add key="huawei" value="https://repo.huaweicloud.com/repository/nuget/v3/index.json" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
    <add key="azure" value="https://nuget.cdn.azure.cn/v3/index.json" />
    <add key="tencent" value="https://mirrors.cloud.tencent.com/nuget/" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
</configuration>

注意:如果你项目里面有Nuget.config同样设置下 

【附录】

添加资源

华为国内镜像
https://repo.huaweicloud.com/repository/nuget/v3/index.json

微软国内镜像
https://nuget.cdn.azure.cn/v3/index.json

腾讯镜像

https://mirrors.cloud.tencent.com/nuget/
Microsoft Visual Studio Offline Packages
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

国外nuget.org
https://api.nuget.org/v3/index.json

【参考文献】

[1] https://stackoverflow.com/questions/61380157/doing-a-local-nuget-package-installation-but-getting-the-error-unable-to-get-r


http://www.kler.cn/news/234533.html

相关文章:

  • 有哪些方法可以配置并发服务器?
  • 软考 系统分析师系列知识点之信息系统战略规划方法(6)
  • ElementUI鼠标拖动没列宽度
  • C++学习笔记——typedef和using
  • 【机器学习300问】23、什么是主动学习?
  • 基于Java实现Socket文件传输代码详解
  • 算法学习系列(三十二):背包问题
  • 笔记——asp.net core 中的 REST
  • 【iOS操作系统——讲解】
  • leetcode-206-翻转链表
  • 【Jenkins】Jenkins关闭Jenkins关闭、重启
  • LeetCode---383周赛
  • 学了很多知识,没多久就忘光了,怎么办?
  • 力扣刷题之旅:进阶篇(六)—— 图论与最短路径问题
  • 网络的基本概念和socket编程
  • java 类加载过程
  • Vulnhub靶机:hacksudo-search
  • Java实现数据可视化的智慧河南大屏 JAVA+Vue+SpringBoot+MySQL
  • 踩坑实录(Second Day)
  • 789. 数的范围(二分模板)
  • ShardingSphere实现openGauss分布式架构
  • 夜天之书 #95 GreptimeDB 社群观察报告
  • 零代码3D可视化快速开发平台
  • 【射影几何15】python双曲几何工具geometry_tools
  • 【Opencv学习】04-图像加法
  • QGIS编译(跨平台编译)之四十九:cairo编译(Windows、Linux、MacOS环境下编译)
  • 基于springboot会员制医疗预约服务管理信息系统源码和论文
  • vue3学习——router-view 过渡动画
  • visual studio code could not establish connection to *: XHR failed
  • GreenSock Animation Platform(GSAP)动画库插件介绍