Nuget
Our development often uses other people's DLLs, then we need to download from the Internet every time, and then copy to our project,
Without knowing if our DLL is safe?
When we update the library, we need to search from the Internet, so it is not good, so we use Nuget,nuget can
Let's send something we made out online for someone else to download, need to search for a name to download, then update will notify
This article mainly tells us how to make a library upload NuGet, let others can use, the procedure is very simple, first download software after production, upload.
Download
Download First
Nuget.exe Https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
If you can't download and I say, I'll send you
Then download a tool https://docs.nuget.org/Create/using-a-gui-to-build-packages and run it after download
We put Nuget.exe in path, and of course we don't know the path, just put it in the project folder we're going to pack.
Package NuGet
We use the MSBuild command to enter the project folder, and if MSBuild is not found, use cmd
The project folder is the folder where we want to package the project *.csproj
My project file SMMs, open the folder where Smms.csproj is located A:\smms\smms
Go to Folder command
First into the disk, I was in a plate,
a:
Then go to the folder
cd smms/smms
We pack
First of all
nuget spec
smms.nuspec
This can be opened with text, which will automatically replace
It's inside.
<?xml version= "1.0"?>< Package > <metadata> <ID>$id $</ID> <version>$version $</version> <title>$title $</title> <authors>$author $</authors> <owners>$author $</owners> <licenseurl>Http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseurl> <projecturl>Http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projecturl> <iconUrl>Http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl> <requirelicenseacceptance>False</requirelicenseacceptance> <description>$description $</Description> <releasenotes>Summary of changes made in this release of the.</releasenotes> <copyright>Copyright 2016</Copyright> <tags>Tag1 Tag2</Tags> </metadata></Package >
Id
The ID of the package: The unique ID must be the same format as the C # Namespace specification, which validates uniqueness when you publish the package.
Version
Version number: The required three-segment version number, note that each publication must be greater than the previous version number, otherwise it will be rejected by NuGet.
Title
Title: Not required, usually you can keep it consistent with the ID, but this is not mandatory.
Authors
Author (s): Required items, comma-delimited list of authors.
Owners
Owner: You can write casually, but will be replaced by your NuGet account name at the time of posting.
Minimum client version: The minimum nuget client version that describes this package limit.
IconUrl
The 32*32
. png file address of a pixel, as the final icon displayed in NuGet
Description, label, license address, project address
Dependencies
We rely on other programs, then write him, specifically how I do not know, I will empty, regardless, as if writing to be found on the NuGet server, or can not complete the automatic reference to add
We can open it in Vs,properties, write our name and description.
Write all of them and generate them.
which he would AssemblyInfo.cs on his $$
behalf.
Author on behalf of Assemblycompany
ID on behalf of assembly name
Version on behalf of AssemblyVersion
Description on behalf of Assemblydescription
Finish our text Open*.nuspec
Change Releasenotes, tags
If not modified, we packnuget pack *.csproj
ofinreleaseofpackage.”是示例值,应将其删除。解决方案: 请替换为适当的值或删除它,然后重新生成程序包。
Write our message and pack it up.
pack smms.csproj
We'll pack our project and we'll see the file folder with*.nupkg
Modify the project address
Upload
First, there is a Microsoft account, login https://www.nuget.org
Click on your Https://www.nuget.org/account
Copy, this key is mine, and yours should be different from mine.
Just copied.
Release
We can be in https://www.nuget.org/account/Packages.
We upload the package, if we want to upload it, our version is bigger than before.
We are
I can't find it, but we're still uploading it.
Installation
Install-Package ID
After you install the search, you can search
See also: http://www.cnblogs.com/xiaoyaojian/p/4199735.html
Command line using NuGet
See also: https://docs.nuget.org/consume/command-line-reference
This work is licensed under the Creative Commons Attribution-NonCommercial use-Share 4.0 International license agreement in the same way. Welcome to reprint, use, republish, but be sure to keep the article Attribution Lindesi (including Link: http://blog.csdn.net/lindexi_gd), not for commercial purposes, based on the modified works of this article must be issued with the same license. If you have any questions, please contact me.
Win10 UWP Upload NuGet Let others use our library