Nuget Study Notes (2) use a graphical interface to package your own class libraries

Source: Internet
Author: User

Previous nuget Study Notes (1) getting started with nuget and quick installation and usage the most important feature of nuget is to build our own nuget server to easily share and update internal class libraries. After the nuget extension is installed, we can easily download the class libraries we need through nuget. The following describes how to package and release our project class libraries.

Use the GUI to package your own class libraries

Nugetyou can use nuget.exe to package class libraries under the command line, or use a graphical interface to package classes. It is estimated that many of my friends are just as familiar with unfamiliar command lines, therefore, we will only describe how to use the graphical interface to package class libraries.

1. First download the Package Manager nugetpackageexplorer. As the name suggests, the package manager can be used to create a new class library package or browse the created class library package.

2. After the download is complete, double-click nugetpackageexplorer. Application to install the package. After the installation is complete, an nuget package explorer shortcut is generated on the desktop.

 

3. Double-click nuget package explorer to display the startup interface. Select create a new package (CTRL + n) to create a new package.

4. Select menuEdit>Edit package metadata(OrCTRL + k) edit the bag Information
You can edit the information of the class library package and add the class library,ProgramSeveral important fields
ID: used to locate the unique identifier of the class library package. For example, execute install-package in the command line. mypackage here is the ID value of the package.
Version: the version number of the class library. It is recommended to be consistent with the actual version number of the Assembly to avoid confusion.
Dependencies: the dependent assembly of the library. You can add the ID and version number of the dependent class library based on the actual situation. If no value is left blank, note that the dependent class library you enter must be found on the nuget server, otherwise, automatic reference cannot be completed.
Framework assemblies: the dependent framework assembly, which can be selected based on actual needs. Generally, no setup is required.

You can modify the attributes other than the preceding four items based on the actual situation. If you do not need to modify the attributes, you are advised to enter the class library description for ease of use.

5. Edit the package information and add the DLL to the package.
You can right-click --> Add existinng file... select DLL to add, or drag the DLL directly to the package contents window. In this example, select the drag mode.

After you drag the DLL directly to the window, a prompt is displayed: whether to put winista. htmlparser. dll in the Lib folder. Generally, we choose yes

 

6. After the DLL is added, press Ctrl + k to change the package information ID to winista. htmlparser, and the version number is 1.8.0.

7. After Information Modification and DLL addition, select file --> Save (or Ctrl + S) to save the file. The default file name is ID + version. nupkg

8. If you want to publish the file to the Internet after saving the file, select file --> Publish... (or Ctrl + p)
The default release address is the official website. You need to register an account for the release key on the official website, and then you can get it. Here we will not repeat it. If you do not need to publish the key, simply close it.

 

PS: This section does not describe how to package project files. Generally, we compile the project file into a DLL and then package it on the GUI to meet the requirements, if the actual work needs to be highly integrated with fully automated operations, you can study the official document http://docs.nuget.org/

By default, the Lib folder is added to the DLL. There are many additional menus.. Net folder, Src folder, and other folders. These folders are only a physical division of files. They are only used to help us classify files. Without other purposes, DLL files can be placed at will, however, we recommend that you place the rules as usual.

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.