Create a NuGet package in 5 minutes

1. Register for a NuGet account to get your Access Key needed for deploying your NuGet Package to the public repository.

2. Install NuGet.

3.  Then download the NuGet.exe command-line utility.

4.  Create a .nuspec file

<?xml version="1.0"?>
<package xmlns="">
  <metadata >
    <authors>Jordan Marr, Rick Schott(NuGet)</authors>
    <description>Marr DataMapper provides a fast and easy to use wrapper around ADO.NET that enables you to focus more on your data access queries without having to write plumbing code.</description>
     <file src="binDebug*.dll" target="lib" />

5. Pack your NuGet package from the command-line:

NuGet.exe pack marrdatamapper.nuspec -b "path to your project"  -o "path for output of generated .nupkg file"

I do mine in the post-build event like this so my .nupkg is always ready to be published:

"$(ProjectDir)NuGetNuGet.exe" pack "$(ProjectDir)NuGetmarrdatamapper.nuspec" -b "$(ProjectDir)"  -o "$(ProjectDir)$(OutDir)"

6.  The last step is to push your .nupkg file to the NuGet Gallery

nuget.exe push "..bin/debug/MarrDataMapper.1.0.0.nupkg" 99999999-9999-9999-9999-999999999999

A fresh new package in the NuGet Gallery online and the Visual Studio Package Manager.

Package Manager Console Command Reference
Creating a Package
.nuspec File Format

4 Responses to Create a NuGet package in 5 minutes

  1. Pingback: Creating an Internal NuGet Feed | coderob

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">