.NET Core study notes 2 - managing nuget packages

.NET Core is based on Nuget packages. It is a zip file with a .nupkg suffix.

tool

dotnet tool

image

Package management console for vs2017

image

Both of these tools can be downloaded, installed, updated, and uploaded from the command line (you must register an account on the website for uploading); you can also use the UI tools in VS to manage them.

image

Project Document Control Package

The project file (.csproj suffix) is an xml file that describes the relationship of referenced packages, and many times this needs to be manually edited to achieve advanced goals.

<ItemGroup>
    <!-- ... -->

    < PackageReference  Include = "Referenced Package"  Version = "Version Number" > 
    </ PackageReference >

    <!-- ... -->
</ItemGroup>

Use the command dotnet add package package id to add a reference. You can also specify the location of the package with the parameter –s package_location. It can be seen that this nuget is a very flexible tool and does not require the package to be placed on the website or any specific location.

Of course, you can also use the ui tool of vs to achieve this purpose, that is, to set the location where the search is added:

image

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325019180&siteId=291194637