DotNetCore cross-platform ~ Precautions for restoring the nuget package on linux: dotnetcorenuget
Background of the problem
Because we use jenkins for deployment (jenkins ~ Cluster distribution functions and responsibilities. the. net core project is cross-platform, so project pulling, package restoration, project compilation, and project release are all performed on a linux jenkins node, while we were developing on a windows system, we encountered some problems during restoration and compilation. Today's article mainly addresses these problems.
. Net frameworks age
We are. in the net era, there is a package management tool nuget, and we already know its benefits. Similar to nodejs npm, it helps us manage project dependencies, and it is very convenient to upgrade and uninstall it. the. net project is stored in the packages directory under the solution. During the release, msbuild will upgrade the project according to this directory. If there is no object packages dependency in this packages, it will be downloaded from the nuget source. The nuget global source is stored in windows, and is generally stored in C: \ Users \ lind \ AppData \ Roaming \ NuGet. in the Config file, and the local system also has a package cache, which is usually stored in the C: \ Program Files (x86) \ Microsoft SDKs \ NuGetPackages \ directory, in this way, the next installation package, you can directly install from the local, the official nuget source address is https://api.nuget.org/v3/index . Json. If you define the nuget server, you can add it to the nuget source and directly modify C: \ Users \ lind \ AppData \ Roaming \ NuGet \ Nuget. the Config file is enough, or you can add it in the tool-option of.
. Net core age
In the cross-platform core era, our packages folder is gone, and the previous packages are stored under the obj directory, while the package ing relationship is in the obj \ project. assets. json file, we can see the package referenced by the current project, the package source, the package cache, and other information.
Note: nuget source address paths in various systems
Errors occurred during the issue generation process when restoring the autonomous Nuget package
Independent dependent package not found
No execution permission for Roslyn
Finally, what is waiting for us is success!
Success is not acceptable!
We hope that through our sharing, we can help you with problems!
Thank you for reading this article!