title: Automating creating NuGet package as part of build process
body: <p>I have an automated build process that I'd like to extend so I can build the libraries I am distributing via NuGet.  Currently, running nuget.exe to create the packages is a manual operation.</p>
  
  <p><strong>What is the best way to setup VS 2010 so that my NuGet package (*.nupkg) file is the end result of a "Release" build?</strong></p>
  
  <p>Keep in mind that I have other files (content and tools) for some of the packages. And, in most cases, I have multiple projects merged into a single NuGet package to support .NET 4, Silveright and Phone 7.</p>
  
  <p><em>(I should clarify that the existing "automated" process is a simple batch-file runner that builds a solution using the command line.)</em></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I want to refresh this discussion because the issue has not been resolved.  While the link @pravin supplied is helpful, it doesn't address the fact that I have multiple projects in a single package as well as other contents like PowerShell scripts, configuration and source code transformations, etc.</p>
  
  <p>The best example I can use is an assembly that has both a .NET 4 and Silverlight 5 version. These are distributed in the same package.  I cannot use a post-build event to create the package because the package is dependent upon TWO projects.</p>