下载地址:
命令行: http://nuget.codeplex.com/downloads/get/669083
命令行: http://nuget.org/downloads
图形窗: https://github.com/NuGetPackageExplorer
*.nuspec
Folder | Description | Action upon package install |
---|---|---|
tools | Powershell scripts and programs accessible from the Package Manager Console | Contents are copied to the project folder, and the tools folder is added to the PATH environment variable. |
lib | Assembly(.dll) files (.dll), documentation (.xml) files, and symbol (.pdb) files | Assemblies are added as references; .xml and .pdb copied into project folders. |
content | Arbitrary files | Contents are copied to the project root |
build | MSBuild .targets and .props files | Automatically inserted into the project file (NuGet 2.x) or project.json.lock (NuGet 3.x). |
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<!-- The identifier that must be unique within the hosting gallery -->
<id>Contoso.Utility.UsefulStuff</id>
<!-- The package version number that is used when resolving dependencies -->
<version>1.8.3.331</version>
<!-- Authors contain text that appears directly on the gallery -->
<authors>Dejana Tesic, Rajeev Dey</authors>
<!-- Owners are typically nuget.org identities that allow gallery
users to earily find other packages by the same owners. -->
<owners>dejanatc, rjdey</owners>
<!-- License and project URLs provide links for the gallery -->
<licenseUrl>http://opensource.org/licenses/MS-PL</licenseUrl>
<projectUrl>http://github.com/contoso/UsefulStuff</projectUrl>
<!-- The icon is used in Visual Studio's package manager UI -->
<iconUrl>http://github.com/contoso/UsefulStuff/nuget_icon.png</iconUrl>
<!-- If true, this value prompts the user to accept the license when
installing the package. -->
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<!-- Any details about this particular release -->
<releaseNotes>Bug fixes and performance improvements</releaseNotes>
<!-- The description can be used in package manager UI. Note that the
nuget.org gallery uses information you add in the portal. -->
<description>Core utility functions for web applications</description>
<!-- Copyright information -->
<copyright>Copyright ©2016 Contoso Corporation</copyright>
<!-- Tags appear in the gallery and can be used for tag searches -->
<tags>web utility http json url parsing</tags>
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="Newtonsoft.Json" version="9.0" />
</dependencies>
</metadata>
<!-- A readme.txt will be displayed when the package is installed -->
<files>
<file src="readme.txt" target="" />
</files>
</package>
命令:
nuget spec
nuget pack ClassLibrary2.csproj -Build -Properties Configuration=Release
nuget push *.nupkg -s http://127.0.0.1 apikey