How to download a Nuget package without nuget.exe or Visual Studio extension?

136,137

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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

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

Solution 5

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)

Share:
136,137

Related videos on Youtube

Colonel Panic
Author by

Colonel Panic

If you really want to understand something, the best way is to try and explain it to someone else. That forces you to sort it out in your mind. And the more slow and dim-witted your pupil, the more you have to break things down into more and more simple ideas. And that's really the essence of programming. By the time you've sorted out a complicated idea into little steps that even a stupid machine can deal with, you've learned something about it yourself. —Douglas Adams

Updated on September 20, 2021

Comments

  • Colonel Panic
    Colonel Panic over 2 years

    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.

    • Gorgsenegger
      Gorgsenegger about 11 years
      @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).
  • Colonel Panic
    Colonel Panic over 11 years
    Thanks Xavier, that worked. For the library I wanted it was nuget.org/api/v2/package/Microsoft.Bcl.Async/1.0.14-rc
  • dirkjot
    dirkjot over 9 years
    If you just want the latest package, simply leave the /{packageVersion} part out.
  • Andy
    Andy over 8 years
    @Muds You'll have to parse the nuspec and download the listed dependences yourself.
  • BartoszKP
    BartoszKP over 8 years
    This answer still works, but is outdated. See below: stackoverflow.com/a/32681762/2642204
  • Gone Coding
    Gone Coding over 8 years
    Yes, it works fine. Just use the "Open from Feed..." option.
  • benmccallum
    benmccallum about 6 years
    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.
  • Adam
    Adam almost 6 years
    Just be aware that you'll have to download any dependent packages manually if you go this route.
  • Mehdi Dehghani
    Mehdi Dehghani about 5 years
    How to download package dependencies?
  • Yves Martin
    Yves Martin over 3 years
    Or else trigger "nuget install" and look for URL used in verbose mode...