153

How can I download a NuGet package? I don't have the NuGet Visual Studio extension or the command line program nuget.exe. How can I download the .nupack file from the web? As I understand I will be able to extract the .dll files from it (with 7-zip) to use as normal.

The package I happen to be interested in is http://nuget.org/packages/Microsoft.Bcl.Async, but I would like to know how to do this generally.

In the world of Ruby this would be easy - every package page on the RubyGems website has a download link to a .gem file, e.g.: https://rubygems.org/gems/pony


The argument over NuGet's manifest destiny belongs elsewhere. It doesn't matter to this question why I eschew it. I'm not the only one though.

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
  • 8
    @JonSkeet: My development system is not connected to the internet (for security reasons) except by using a Windows Terminal Server session. This WTS does allow downloads, but I cannot start executeables, so there is no (convenient) way for me to get stuff that's only available via nuget (at least whilst at work, anyway). – Gorgsenegger Mar 08 '13 at 16:22

7 Answers7

223

Either make an account on the Nuget.org website, then log in, browse to the package you want and click on the Download link on the left menu.


Or guess the URL. They have the following format:

https://www.nuget.org/api/v2/package/{packageID}/{packageVersion}

Then simply unzip the .nupkg file and extract the contents you need.

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
Xavier Decoster
  • 14,580
  • 5
  • 35
  • 46
93

Although building the URL or using tools is still possible, it is not needed anymore.

https://www.nuget.org/ currently has a download link named "Download package", that is available even if you don't have an account on the site.

(at the bottom of the right column).


Example of EntityFramework's detail page: https://www.nuget.org/packages/EntityFramework/: (Updated after comment of kwitee.)

Example of EntityFramework's detail page

quasoft
  • 5,291
  • 1
  • 33
  • 37
  • 10
    FYI, you can definitely use 7-zip to extract and it'll handle .nupkg filetype, but since they are just .zip files under the hood, you can also just change the extension to .zip and browse/unzip as needed. – benmccallum Mar 10 '18 at 13:35
  • 1
    Just be aware that you'll have to download any dependent packages manually if you go this route. – Adam Aug 01 '18 at 17:41
  • Or else trigger "nuget install" and look for URL used in verbose mode... – Yves Martin Feb 22 '21 at 16:37
35

Based on Xavier's answer, I wrote a Google chrome extension NuTake to add links to the Nuget.org package pages.

Marcello Miorelli
  • 3,368
  • 4
  • 44
  • 67
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
12

To obtain the current stable version of the NuGet package use:

https://www.nuget.org/api/v2/package/{packageID}
BartoszKP
  • 34,786
  • 15
  • 102
  • 130
WorkSmarter
  • 3,738
  • 3
  • 29
  • 34
8

I haven't tried it yet, but it looks like NuGet Package Explorer should be able to do it:

https://github.com/NuGetPackageExplorer/NuGetPackageExplorer

NuGet Package Explorer

(or like Colonel Panic says, 7-zip should probably do it)

MJ Vakili
  • 2,798
  • 1
  • 19
  • 25
Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152
6
  1. Go to http://www.nuget.org
  2. Search for desired package. For example: Microsoft.Owin.Host.SystemWeb
  3. Download the package by clicking the Download link on the left.
  4. Do step 3 for the dependencies which are not already installed. Nuget download page
  5. Store all downloaded packages in a custom folder. The default is c:\Package source.
  6. Open Nuget Package Manager in Visual Studio and make sure you have an "Available package source" that points to the specified address in step 5; If not, simply add one by providing a custom name and address. Click OK. Tools->Manage NuGet Packages->Package Manager Settings NuGet Package Manager Options Window
  7. At this point you should be able to install the package exactly the same way you would install an online package through the interface. You probably won't be able to install the package using NuGet console.
0

Don't know if this is what you want, but here it is:

  1. Download nuget.exe (∼6.5MB, no install required) from the official NuGet site: https://www.nuget.org/downloads
  2. In CLI type following to retrieve list of available packages: nuget.exe list -source <source-url-here>
  3. Then download the package by typing this: nuget.exe install <package-name> -source <source-url-here> -OutputDirectory <download-directory>

Contents of the downloaded package are the .nupkg file, .dll files for x86 and x64 as well as .props and .targets files. BTW: .nupkg can be opened as a .zip file.

Semi
  • 93
  • 7