This article is a mirror article of machine translation, please click here to jump to the original article.

View: 48366|Reply: 3

[Tips] Use Tencent Cloud Nuget Package Manager to speed up downloads

[Copy link]
Posted on 7/30/2019 9:57:27 AM | | | |
NuGet is a package manager for .NET. NuGet client tools provide the ability to build and use packages. As a .NET developer, you need to use NuGet to download packages frequently, and in order to improve the download speed of packages, you may use some domestic image sources to speed up the download.
Previously, it was written that the image source of Blog Garden was used to speed up downloads, as follows:

Nuget Domestic Source (Mirror Source)
https://www.itsvse.com/thread-3925-1-1.html

Following Alibaba's open source mirror station (The hyperlink login is visible.), HUAWEI CLOUD Image Site (The hyperlink login is visible.After that, Tencent has also recently launched a similar service, officially named Tencent Open Source Mirror Site, to provide domestic developers with a new choice of software image sources.


To solve the problem of slow access speed to official sources when software is installed dependently, Tencent Cloud has built a caching service for some software. You can use the Tencent Cloud software origin server to speed up the installation of dependent packages. In order to facilitate users to freely build service architectures, Tencent Cloud software origin servers currently support public network access and private network access.

Public network access address:The hyperlink login is visible.
Intranet access address:The hyperlink login is visible.


Nuget image address:The hyperlink login is visible.
In 2017, Microsoft optimized the problem of slow access to Nuget services in China, backed up blob storage to China, and used a local CDN service provider to handle package download requests.The hyperlink login is visible.


The API of Nuget packages is divided into three categories: search, registration, and storage. The most frequently used are registration and storage APIs. Nuget images include cached reverse proxies to accelerate these APIs. Using this image can be used in Tencent Cloud and application development, the following acceleration effects can be achieved:

  • For package searches: no acceleration effect. Search component packages are provided by additional domain names.
  • Install, uninstall, upgrade packages, etc.: fully accelerated. All packet information is cached on the server on a daily basis, and the first access of each packet each day is a proxy access, followed by local access
  • Package installation, upgrade, and download files: Fully accelerated. Each version of each package is downloaded for the first time for microproxy access, and then all packages with the same version and ID are accessed locally



Use the tutorial

Click "Tools" - "Options" in Visual Studio, find "Nuget Package Manager" - "Package Source" on the left, and confirm that your list contains the V3 version of the API (https://api.nuget.org/v3/index.json)。 Tencent Cloud's acceleration service only supports the V3 version of the package source, if there is no record of this, then you may not be able to use the acceleration service, please upgrade your Nuget package manager.



Click the Add button and enter your information below:

Name: Tencent Nuget

Package Address:The hyperlink login is visible.

Once entered, click the Update button to update, and finally confirm and close the configuration.


After the above settings, the relevant configuration is added to the Nuget configuration file, the file location is at: C:\Users\itsvse\AppData\Roaming\NuGet\Nuget.config, where itsvse is my computer account, change your account, the following is my Nuget configuration example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Tencent Nuget" value="https://mirrors.cloud.tencent.com/nuget/" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
  </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>


We are all on Windows 10 for the above operations, especially to do. NET Core development, many students like to use Mac, if the path in Mac and Linux is, then the path is ~/.nuget/NuGet/NuGet.Config.

Note: The path of NuGet.Config in Windows is %appdata%\NuGet\NuGet.Config, and the path in Mac and Linux is ~/.nuget/NuGet/NuGet.Config, if there is no NuGet.Config file, you can run the dotnet restore command to generate.


When you use dotnet restore, you can also specify the use of Tencent Cloud image by –s.

(End)




Previous:Zheng Qian talks about investment: super practical investment psychology
Next:How do I change the name of a table in mysql? Modify the table name?
 Landlord| Posted on 7/30/2019 10:22:40 AM |
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<service xml:base="http://100.67.92.24/repository/nuget-group/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
  <workspace>
    <atom:title>Default</atom:title>
    <collection href="Packages">
      <atom:title>Packages</atom:title>
    </collection>
  </workspace>
</service>

The test is not available, as shown below:



It has been fixed, as shown below:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<service xml:base="http://mirrors.cloud.tencent.com/repository/nuget-group/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
  <workspace>
    <atom:title>Default</atom:title>
    <collection href="Packages">
      <atom:title>Packages</atom:title>
    </collection>
  </workspace>
</service>




 Landlord| Posted on 7/30/2019 10:26:22 AM |
HUAWEI CLOUD Nuget image address:The hyperlink login is visible.

The test is available as shown below:


 Landlord| Posted on 8/2/2021 2:46:49 PM |
HUAWEI CLOUD image address:https://mirrors.huaweicloud.com/home
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com