OR博客
NuGet修改镜像源
OrdinaryRoad
创建于:2024-03-26 19:26:37
河南省
0
11
83
0
> 原文链接:https://www.cnblogs.com/Leo_wl/p/16328650.html > 镜像源:https://www.cnblogs.com/TianFang/p/14290586.html 收录几个国内Nuget镜像,以加速Nuget访问速度。 * 博客园:[https://nuget.cnblogs.com/v3/index.json](https://nuget.cnblogs.com/v3/index.json) * 华为云:** **[https://repo.huaweicloud.com/repository/nuget/v3/index.json](https://repo.huaweicloud.com/repository/nuget/v3/index.json) * 微软Azure:[https://nuget.cdn.azure.cn/v3/index.json](https://nuget.cdn.azure.cn/v3/index.json) 其中,感觉华为云的最快,博客园和微软自己的速度也还可以,比nuget国外的的服务器要快得多了。 另外,也看到可以通过在阿里云nginx反向代理的方式架设私有服务器的,参考:[nuget国内镜像的解决办法](https://www.cnblogs.com/yuzukwok/p/4657969.html) --- **阅读目录** * [NuGet镜像上线试运行](https://www.cnblogs.com/Leo_wl/p/16328650.html#_label0) 为解决国内访问NuGet[服务器](https://cloud.tencent.com/product/cvm?from=10680)速度不稳定的问题 ,这里推荐使用NuGet微软官方中国国内镜像 地址:https://nuget.cdn.azure.cn/v3/index.json 添加NuGet源的方式 菜单: 工具 -> NuGet包管理器 -> 程序包管理器设置 ![](https://img2022.cnblogs.com/blog/104109/202205/104109-20220530223756266-779953964.png) [回到目录](https://www.cnblogs.com/Leo_wl/p/16328650.html#_labelTop) # [NuGet镜像上线试运行](https://www.cnblogs.com/cmt/p/nuget-mirror.html) 为解决国内访问NuGet服务器速度不稳定的问题,我们用阿里云服务器搭建了一个NuGet镜像,目前已上线试运行。 使用NuGet镜像源的方法如下: 1)NuGet镜像源地址:https://nuget.cnblogs.com/v3/index.json 2)在NuGet.Config中添加这个镜像源: [![复制代码](https://assets.cnblogs.com/images/copycode.gif)]() [![复制代码](https://common.cnblogs.com/images/copycode.gif)]() ``` <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.cnblogs.com" value="https://nuget.cnblogs.com/v3/index.json" protocolVersion="3" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> </packageSources> <packageRestore> <add key="enabled" value="True" /> <add key="automatic" value="True" /> </packageRestore> <bindingRedirects> <add key="skip" value="False" /> </bindingRedirects> </configuration> ``` [![复制代码](https://common.cnblogs.com/images/copycode.gif)]() [![复制代码](https://assets.cnblogs.com/images/copycode.gif)]() 注:NuGet.Config 在 Windows 中路径是 %appdata%\\NuGet\\NuGet.Config ,在 Mac 与 Linux 中的路径是 \~/.nuget/NuGet/NuGet.Config ,如果没有 NuGet.Config 文件,可以运行 dotnet restore 命令生成。 或者在Visual Studio中的添加方法: ![](https://images2015.cnblogs.com/blog/35695/201612/35695-20161218192733183-1153975983.png) 由于目前带宽有限,如果出现下面的问题,说明当前带宽跑满了,您可以稍后再试。 ``` The download of 'https://nuget.cnblogs.com/v3-flatcontainer/system.runtime.extensions/4.3.0/system.runtime.exten ```
评论