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

View: 7247|Reply: 3

[ASP.NET] [Practical Battle] Packaging ASP.NET Cores into an Image NUGET Timeout Issue

[Copy link]
Posted on 6/5/2022 10:02:29 PM | | | |
Requirements: Package the project that previously used ASP.NET Core 6.0 into a Docker image, and then run it on the router (openwrt), and when executing the package into a Docker image, a timeout error will occur when restoring the Nuget package with dotnet restore, as shown in the figure below:



  Determining projects to restore...
  Failed to download package 'SkiaSharp.2.80.3' from 'https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.3/skiasharp.2.80.3.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.3/skiasharp.2.80.3.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
  Failed to download package 'SkiaSharp.NativeAssets.Linux.2.80.3' from ' https://api.nuget.org/v3-flatcontainer/skiasharp.nativeassets.linux/2.80.3/skiasharp.nativeassets.linux.2.80.3.nupkg'.
  The download of 'https://api.nuget.org/v3-flatcontainer/skiasharp.nativeassets.linux/2.80.3/skiasharp.nativeassets.linux.2.80.3.nupkg' timed out because no data was received for 60000ms.
    Exception of type 'System.TimeoutException' was thrown.
The project Dockerfile is configured by default:

The package into docker image command is as follows:



It was discovered through the search engine that other users were also experiencing similar problems, link:The hyperlink login is visible.

According to the answers of netizens, try to increase--disable-parallelParameter parallelism is disabled, modified as follows:



Discoveries will still appearSystem.TimeoutExceptionSince it is a timeout to restore the nuget package timeout, why can't we change the source? Decisively replaced with Tencent's nuget source, with the following reference:

Use Tencent Cloud Nuget Package Manager to speed up downloads
https://www.itsvse.com/thread-7875-1-1.html

Nuget Domestic Source (Mirror Source)
https://www.itsvse.com/thread-3925-1-1.html
Modify the Dockerfile file, remove the default nuget.org, and add the source of Tencent Cloud, as follows:

At lastSuccessfully packaged into a docker image, it took 22 seconds to restore the nuget package, there is no timeout problem, as shown in the figure below:



(End)




Previous:fdisk_dos_fix_chs: symbol not found
Next:Newcomers post, PHP summarizes 6 ways to traverse arrays
 Landlord| Posted on 6/5/2022 10:09:17 PM |
Look at the default nuget feed


Posted on 6/6/2022 11:14:48 AM |
This must be learned a new skill
Posted on 6/17/2022 9:29:53 AM |
This must be learned. New Skill Collection
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