Skip to content

Building NuGet Package Without NuGet Package Explorer

Daryl LaBar edited this page Apr 28, 2016 · 1 revision

Against GUIs? Really love .bat files? Here is how to setup a .bat file to create a NuGet package:

  1. Create a folder locally (C:\Something\Nuget)
  2. Download NuGet.exe to folder from step 1
  3. Create a bat file ("Build - MyPlugin.bat")
  4. Edit the bat file with the Example Bat File below (assuming your NuSpec file is "MYPLUGIN.nuspec")
  5. Make sure you've built the latest and greatest version of your plugin dll(s), and your nuspec file is correct.
  6. Run the bat file. Verify the version # that get's created is correct.
  7. Press "Enter" to push the package to NuGet, or close the window to cancel.

#Example Bat File

echo Deleting Previous NuGet Packages
del MYPLUGIN*.nupkg
nuget.exe pack "C:\YourPath\MYPLUGIN.nuspec"
echo Press Enter to Push
pause
nuget.exe push MYPLUGIN*.nupkg <YOUR NUGET KEY GOES HERE> 
pause