-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNuGet-simple-steps-to-create-and-publish-nuget-packages.html
More file actions
57 lines (45 loc) · 4.89 KB
/
NuGet-simple-steps-to-create-and-publish-nuget-packages.html
File metadata and controls
57 lines (45 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>NuGet simple steps to create and publish nuget packages</title>
<meta name="twitter:title" property="og:title" content="NuGet simple steps to create and publish nuget packages">
<meta name="twitter:description" property="og:description">
<meta property="og:url" content="https://docsroot.github.io/NuGet-simple-steps-to-create-and-publish-nuget-packages.html">
<meta property="og:type" content="website">
<meta property="og:site_name" content="DocsRoot">
<meta name="author" content="hu****hd@gmail.com" />
<meta name="creator" content="docsroot" />
<style type="text/css">
blockquote {
border-left: 5px solid green;
margin: 10px;
padding: 10px;
}
img {
max-width: 100%;
height: auto;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #DDD;
text-align: center;
height: 22px;
line-height: 22px;
}
</style>
</head>
<body>
<!--Heading of the page-->
<h1>NuGet simple steps to create and publish nuget packages</h1>
<!--The body part: what you put into RTE-->
<p>When we want to publish some DLL files as a package onto nuget.org, it is required to create a nupack file then publish it.</p><p>I was using NuGet Packager (it creates a project, add dll files into libs folder, update nuspec files, build the project in release mode, then a package will be published on nuget.org). But it is not being maintained and seems being outdate on new nuget version.</p><p>Below are simple steps to build/publish a package:</p><p>1/ Create a Package.nuspec file</p><p>Below is a sample (replace id, version, title, owners, dependencies... by yours).</p><p>Then besure that all files are added into folders libs / content / tools.</p><blockquote><?xml version="1.0"?><br><package ><br> <metadata><br> <id>Rabbit.Web.MvcNotification</id><br> <version>1.2.0</version><br> <title>Rabbit.Web.MvcNotification</title><br> <authors>juniho</authors><br> <owners>RabbitSoftware</owners><br> <description><br> Provides an option to display user messages<br> </description><br> <releaseNotes><br> </releaseNotes><br> <summary><br> </summary><br> <language>en-US</language><br> <projectUrl>https://nuget.org/packages/NuGet.Rabbit.Web.MvcNotification</projectUrl><br> <iconUrl>https://nuget.org/Content/Images/packageDefaultIcon-50x50.png</iconUrl><br> <requireLicenseAcceptance>false</requireLicenseAcceptance><br> <licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl><br> <copyright>Copyright @ RabbitSoftware 2018</copyright><br> <dependencies><br> <group targetFramework="net46"><br> <dependency id="Microsoft.AspNet.Mvc" version="5.2.6" /><br> </group><br> </dependencies><br> <references></references><br> <tags></tags><br> </metadata><br> <files><br> <file src="lib\" target="lib" /><br> <file src="tools\" target="tools" /><br> <file src="content\" target="content" /><br> </files><br></package></blockquote><p>2/ Create a package with nuget pack</p><p>The command to use is</p><blockquote>nuget pack <Path To Package NuSpec File></blockquote><p>3/ Publish the package to nuget.org</p><p>The command below will do the job</p><blockquote><p>nuget push <Path To nupkg File> -Source <a href="https://api.nuget.org/v3/index.json">https://api.nuget.org/v3/index.json</a><a href="https://api.nuget.org/v3/index.json"></a> -ApiKey "<The Key>"</p></blockquote><p><b>References:</b><br></p><ul><li><a href="https://docs.microsoft.com/en-us/nuget/create-packages/publish-a-package" target="_blank">Publishing packages</a><br></li></ul>
<footer>
By <a href="http://docsroot.devcovery.com/Listing/ViewBy?author=1" target="_blank">hu****hd@gmail.com</a> at 10/10/2019 11:19:31 AM. <a href="https://docsroot.github.io/NuGet-simple-steps-to-create-and-publish-nuget-packages.html" target="_blank">View online</a>. Built with ♥ by <a href="http://docsroot.devcovery.com" target="_blank">docsroot</a>
</footer>
</body>
</html>