How to download a Nuget package without nuget.exe or Visual Studio extension?
C#.NetVisual StudioNugetC# Problem Overview
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.
C# Solutions
Solution 1 - C#
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 2 - C#
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.)
Solution 3 - C#
Based on Xavier's answer, I wrote a Google chrome extension NuTake to add links to the Nuget.org package pages.
Solution 4 - C#
To obtain the current stable version of the NuGet package use:
https://www.nuget.org/api/v2/package/{packageID}
Solution 5 - C#
I haven't tried it yet, but it looks like NuGet Package Explorer should be able to do it:
https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
(or like Colonel Panic says, 7-zip should probably do it)
Solution 6 - C#
- Go to http://www.nuget.org
- Search for desired package. For example: Microsoft.Owin.Host.SystemWeb
- Download the package by clicking the Download link on the left.
- Do step 3 for the dependencies which are not already installed.
- Store all downloaded packages in a custom folder. The default is c:\Package source.
- 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.
- 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.
Solution 7 - C#
Don't know if this is what you want, but here it is:
- Download
nuget.exe
(∼6.5MB, no install required) from the official NuGet site: https://www.nuget.org/downloads - In CLI type following to retrieve list of available packages:
nuget.exe list -source <source-url-here>
- 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.