NuGet Management package dependencies used in the solution

Source: Internet
Author: User

Using the package recovery feature, you can significantly reduce the size of your project by submitting the source code without having to submit the code base to source code control. All NuGet packages are stored in the solution's Packages folder.

To enable package recovery, right-click the solution (Note that the project file is not right-clicked) and select the Enable NuGet package restore option. A series of prompt dialog boxes appear on the screen

We will see a confirmation prompt dialog box.

Once you are sure, start configuring Nuget package management for your solution. After the configuration is complete, there is a hint.

When you are finished, a. NuGet solution folder is added to the solution.

Later, in the solution, when the project needs to add a NuGet package reference, the NuGet Package Manager can be found through the project's right-click menu.

For example, we can add a Redis package to the project.

After the add is complete.

Note that a packages.config file has been added to the project.

Contents of the Packages.config file in the project file

<? XML version= "1.0" encoding= "Utf-8" ?> < Packages >  <  ID= "Stackexchange.redis"  version= "1.0.414 " targetframework= "net45"/></packages>

The actual assembly is saved in the solution's folder.

When you check in your code, you do not need to check the assembly files in packages into code management, which reduces the size of the codebase.

After checking out the code, if we are missing a code base locally, such as JQuery

<?XML version= "1.0" encoding= "Utf-8"?><Packages>  < PackageID= "Stackexchange.redis"version= "1.0.414"targetframework= "Net45" />  < PackageID= "JQuery"version= "2.1.3"targetframework= "Net45" /></Packages>

We can manage NuGet packages for the solution in the right-click menu in the solution.

If there is a missing package in our solution, there will be a yellow cue bar on the Open dialog box title. There is a restore on the far right, and when clicked, NuGet will automatically download the corresponding code base to the Packages folder on the local solution.

NuGet Management package dependencies used in the solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.